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
815177af
Commit
815177af
authored
Feb 24, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #883 from masamitsu-murase/modify_node_rescue_handling
Adjust stack position of NODE_RESCUE.
parents
bbd50cca
efa18038
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
src/codegen.c
src/codegen.c
+4
-0
test/t/exception.rb
test/t/exception.rb
+28
-0
No files found.
src/codegen.c
View file @
815177af
...
...
@@ -1083,6 +1083,7 @@ codegen(codegen_scope *s, node *tree, int val)
}
if
(
n3
->
cdr
->
cdr
->
car
)
{
codegen
(
s
,
n3
->
cdr
->
cdr
->
car
,
val
);
if
(
val
)
pop
();
}
tmp
=
new_label
(
s
);
genop
(
s
,
MKOP_sBx
(
OP_JMP
,
exend
));
...
...
@@ -1102,6 +1103,9 @@ codegen(codegen_scope *s, node *tree, int val)
if
(
tree
->
car
)
{
codegen
(
s
,
tree
->
car
,
val
);
}
else
if
(
val
)
{
push
();
}
dispatch_linked
(
s
,
exend
);
loop_pop
(
s
,
NOVAL
);
}
...
...
test/t/exception.rb
View file @
815177af
...
...
@@ -287,6 +287,34 @@ assert('Exception 16') do
end
end
assert
(
'Exception 17'
)
do
begin
raise
"a"
# StandardError
rescue
ArgumentError
1
rescue
StandardError
2
else
3
ensure
4
end
==
2
end
assert
(
'Exception 18'
)
do
begin
0
rescue
ArgumentError
1
rescue
StandardError
2
else
3
ensure
4
end
==
3
end
assert
(
'Exception#inspect without message'
)
do
Exception
.
new
.
inspect
end
...
...
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