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
89a18e4f
Commit
89a18e4f
authored
Oct 20, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unexpect break/next/redo/retry should raise LocalJumpError
parent
9bb6f0b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
12 deletions
+15
-12
src/codegen.c
src/codegen.c
+1
-1
src/vm.c
src/vm.c
+7
-1
test/t/localjumperror.rb
test/t/localjumperror.rb
+6
-1
test/t/runtimeerror.rb
test/t/runtimeerror.rb
+1
-9
No files found.
src/codegen.c
View file @
89a18e4f
...
...
@@ -911,7 +911,7 @@ raise_error(codegen_scope *s, const char *msg)
{
int
idx
=
new_lit
(
s
,
mrb_str_new_cstr
(
s
->
mrb
,
msg
));
genop
(
s
,
MKOP_ABx
(
OP_ERR
,
0
,
idx
));
genop
(
s
,
MKOP_ABx
(
OP_ERR
,
1
,
idx
));
}
static
double
...
...
src/vm.c
View file @
89a18e4f
...
...
@@ -1817,8 +1817,14 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
CASE
(
OP_ERR
)
{
/* Bx raise RuntimeError with message Lit(Bx) */
mrb_value
msg
=
pool
[
GETARG_Bx
(
i
)];
mrb_value
exc
=
mrb_exc_new3
(
mrb
,
E_RUNTIME_ERROR
,
msg
)
;
mrb_value
exc
;
if
(
GETARG_A
(
i
)
==
0
)
{
exc
=
mrb_exc_new3
(
mrb
,
E_RUNTIME_ERROR
,
msg
);
}
else
{
exc
=
mrb_exc_new3
(
mrb
,
E_LOCALJUMP_ERROR
,
msg
);
}
mrb
->
exc
=
(
struct
RObject
*
)
mrb_object
(
exc
);
goto
L_RAISE
;
}
...
...
test/t/localjumperror.rb
View file @
89a18e4f
...
...
@@ -2,7 +2,12 @@
# LocalJumpError ISO Test
assert
(
'LocalJumoError'
,
'15.2.25'
)
do
LocalJumpError
.
class
==
Class
begin
# this will cause an exception due to the wrong location
retry
rescue
=>
e1
end
LocalJumpError
.
class
==
Class
and
e1
.
class
==
LocalJumpError
end
# TODO 15.2.25.2.1 LocalJumpError#exit_value
...
...
test/t/runtimeerror.rb
View file @
89a18e4f
...
...
@@ -2,13 +2,5 @@
# RuntimeError ISO Test
assert
(
'RuntimeError'
,
'15.2.28'
)
do
e2
=
nil
begin
# this will cause an exception due to the wrong location
retry
rescue
=>
e1
e2
=
e1
end
RuntimeError
.
class
==
Class
and
e2
.
class
==
RuntimeError
RuntimeError
.
class
==
Class
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