summaryrefslogtreecommitdiff
path: root/vm_eval.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-10 18:39:46 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-10 18:39:46 +0000
commit46cdb8f18766383a9e11b5a6e9a0c010e7e8653a (patch)
treedb3496b8d312e6a7123f176591262e10dc9c3a1a /vm_eval.c
parent9d937bb08640107e13a3f6afece074c753afd974 (diff)
* vm_insnhelper.h: define struct THROW_DATA to represent
throwing data. Also define accessor functions. * eval_intern.h: move related changes into vm_insnhelper.h. Now these MACROs (functions) are only used in vm*.c. There is only THROW_DATA_P(err) to check this data type or not. * vm.c: catch up these changes. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r--vm_eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vm_eval.c b/vm_eval.c
index dbc77a5..9ba940c 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1130,15 +1130,15 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
retval = (*it_proc) (data1);
}
else {
- VALUE err = th->errinfo;
+ const struct THROW_DATA *err = (struct THROW_DATA *)th->errinfo;
if (state == TAG_BREAK) {
- rb_control_frame_t *escape_cfp = GET_THROWOBJ_CATCH_POINT(err);
+ const rb_control_frame_t *escape_cfp = THROW_DATA_CATCH_FRAME(err);
if (cfp == escape_cfp) {
state = 0;
th->state = 0;
th->errinfo = Qnil;
- retval = GET_THROWOBJ_VAL(err);
+ retval = THROW_DATA_VAL(err);
rb_vm_rewind_cfp(th, cfp);
}
@@ -1147,7 +1147,7 @@ rb_iterate(VALUE (* it_proc) (VALUE), VALUE data1,
}
}
else if (state == TAG_RETRY) {
- rb_control_frame_t *escape_cfp = GET_THROWOBJ_CATCH_POINT(err);
+ const rb_control_frame_t *escape_cfp = THROW_DATA_CATCH_FRAME(err);
if (cfp == escape_cfp) {
rb_vm_rewind_cfp(th, cfp);
@@ -1878,8 +1878,8 @@ rb_throw_obj(VALUE tag, VALUE value)
desc[2] = rb_str_new_cstr("uncaught throw %p");
rb_exc_raise(rb_class_new_instance(numberof(desc), desc, rb_eUncaughtThrow));
}
- th->errinfo = NEW_THROW_OBJECT(tag, 0, TAG_THROW);
+ th->errinfo = (VALUE)NEW_THROW_DATA(tag, NULL, TAG_THROW);
JUMP_TAG(TAG_THROW);
}