Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
ced8fea3
Commit
ced8fea3
authored
Feb 26, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #898 from masamitsu-murase/modify_return_value
Modify handling of NODE_RETURN and NODE_NEXT.
parents
2a932441
f413e688
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
src/codegen.c
src/codegen.c
+11
-3
test/t/exception.rb
test/t/exception.rb
+5
-5
No files found.
src/codegen.c
View file @
ced8fea3
...
...
@@ -1570,15 +1570,20 @@ codegen(codegen_scope *s, node *tree, int val)
break
;
case
NODE_RETURN
:
if
(
tree
)
{
codegen
(
s
,
tree
,
VAL
);
pop
();
}
else
{
genop
(
s
,
MKOP_A
(
OP_LOADNIL
,
cursp
()));
}
if
(
s
->
loop
)
{
genop
(
s
,
MKOP_AB
(
OP_RETURN
,
cursp
(),
OP_R_RETURN
));
}
else
{
genop_peep
(
s
,
MKOP_AB
(
OP_RETURN
,
cursp
(),
OP_R_NORMAL
),
NOVAL
);
}
push
();
if
(
val
)
push
();
break
;
case
NODE_YIELD
:
...
...
@@ -1630,6 +1635,9 @@ codegen(codegen_scope *s, node *tree, int val)
codegen
(
s
,
tree
,
VAL
);
pop
();
}
else
{
genop
(
s
,
MKOP_A
(
OP_LOADNIL
,
cursp
()));
}
genop_peep
(
s
,
MKOP_AB
(
OP_RETURN
,
cursp
(),
OP_R_NORMAL
),
NOVAL
);
}
if
(
val
)
push
();
...
...
test/t/exception.rb
View file @
ced8fea3
...
...
@@ -321,7 +321,7 @@ end
# very deeply recursive function that stil returns albeit very deeply so
$test_infinite_recursion
=
0
TEST_INFINITE_RECURSION_MAX
=
100000
TEST_INFINITE_RECURSION_MAX
=
100000
0
def
test_infinite_recursion
$test_infinite_recursion
+=
1
if
$test_infinite_recursion
>
TEST_INFINITE_RECURSION_MAX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment