summaryrefslogtreecommitdiff
path: root/vm_insnhelper.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_insnhelper.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_insnhelper.c')
-rw-r--r--vm_insnhelper.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index ccc18c5aa7..8b907bfc35 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -627,10 +627,9 @@ vm_setinstancevariable(VALUE obj, ID id, VALUE val, IC ic)
}
static VALUE
-vm_throw_continue(rb_thread_t *th, VALUE throwobj)
+vm_throw_continue(rb_thread_t *th, VALUE err)
{
/* continue throw */
- VALUE err = throwobj;
if (FIXNUM_P(err)) {
th->state = FIX2INT(err);
@@ -638,8 +637,8 @@ vm_throw_continue(rb_thread_t *th, VALUE throwobj)
else if (SYMBOL_P(err)) {
th->state = TAG_THROW;
}
- else if (BUILTIN_TYPE(err) == T_NODE) {
- th->state = GET_THROWOBJ_STATE(err);
+ else if (THROW_DATA_P(err)) {
+ th->state = THROW_DATA_STATE((struct THROW_DATA *)err);
}
else {
th->state = TAG_RAISE;
@@ -778,7 +777,7 @@ vm_throw_start(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, int s
}
th->state = state;
- return (VALUE)NEW_THROW_OBJECT(throwobj, (VALUE)escape_cfp, state);
+ return (VALUE)NEW_THROW_DATA(throwobj, escape_cfp, state);
}
static VALUE