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
26a75d85
Commit
26a75d85
authored
Aug 12, 2012
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #420 from masamitsu-murase/modify_exception_handling
Modify exception handling
parents
119b9f5b
686b6eb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
src/vm.c
src/vm.c
+6
-0
test/t/exception.rb
test/t/exception.rb
+16
-0
No files found.
src/vm.c
View file @
26a75d85
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include <stdio.h>
#include <stdio.h>
#include <string.h>
#include <string.h>
#include <setjmp.h>
#include <setjmp.h>
#include <stddef.h>
#define STACK_INIT_SIZE 128
#define STACK_INIT_SIZE 128
#define CALLINFO_INIT_SIZE 32
#define CALLINFO_INIT_SIZE 32
...
@@ -402,6 +403,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
...
@@ -402,6 +403,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
int
ai
=
mrb
->
arena_idx
;
int
ai
=
mrb
->
arena_idx
;
jmp_buf
*
prev_jmp
=
(
jmp_buf
*
)
mrb
->
jmp
;
jmp_buf
*
prev_jmp
=
(
jmp_buf
*
)
mrb
->
jmp
;
jmp_buf
c_jmp
;
jmp_buf
c_jmp
;
ptrdiff_t
ciidx
=
mrb
->
ci
-
mrb
->
cibase
;
#ifdef DIRECT_THREADED
#ifdef DIRECT_THREADED
static
void
*
optable
[]
=
{
static
void
*
optable
[]
=
{
...
@@ -1028,6 +1030,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
...
@@ -1028,6 +1030,10 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
ci
=
mrb
->
ci
;
ci
=
mrb
->
ci
;
eidx
=
mrb
->
ci
->
eidx
;
eidx
=
mrb
->
ci
->
eidx
;
if
(
ci
==
mrb
->
cibase
)
goto
L_STOP
;
if
(
ci
==
mrb
->
cibase
)
goto
L_STOP
;
if
(
ciidx
==
ci
-
mrb
->
cibase
){
mrb
->
jmp
=
prev_jmp
;
longjmp
(
*
(
jmp_buf
*
)
mrb
->
jmp
,
1
);
}
while
(
ci
[
0
].
ridx
==
ci
[
-
1
].
ridx
)
{
while
(
ci
[
0
].
ridx
==
ci
[
-
1
].
ridx
)
{
cipop
(
mrb
);
cipop
(
mrb
);
ci
=
mrb
->
ci
;
ci
=
mrb
->
ci
;
...
...
test/t/exception.rb
View file @
26a75d85
...
@@ -253,3 +253,19 @@ assert('Exception 13') do
...
@@ -253,3 +253,19 @@ assert('Exception 13') do
end
end
a
==
:ok
a
==
:ok
end
end
def
exception_test14
UnknownConstant
end
assert
(
'Exception 14'
)
do
a
=
:ng
begin
send
(
:exception_test14
)
rescue
a
=
:ok
end
a
==
:ok
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