aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-20 00:08:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-20 00:08:23 +0000
commit1b8ff4f799ba47d77b80a48e7504f49ddfd35239 (patch)
treeece7107088ba1e74eeb8fb163ccfa87f532b3d18 /vm_insnhelper.c
parent46b70c8da5e3a355f20ebb3f90441336cca73cf1 (diff)
downloadruby-1b8ff4f799ba47d77b80a48e7504f49ddfd35239.tar.gz
ruby_vm_throw_flags
* vm_core.h (ruby_vm_throw_flags): constants for throw. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index da4ea9db03..8e85174bed 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -830,7 +830,8 @@ vm_throw_continue(rb_thread_t *th, VALUE err)
}
static VALUE
-vm_throw_start(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, int state, const int flag, const rb_num_t level, const VALUE throwobj)
+vm_throw_start(rb_thread_t *const th, rb_control_frame_t *const reg_cfp, enum ruby_tag_type state,
+ const int flag, const rb_num_t level, const VALUE throwobj)
{
rb_control_frame_t *escape_cfp = NULL;
const rb_control_frame_t * const eocfp = RUBY_VM_END_CONTROL_FRAME(th); /* end of control frame pointer */
@@ -966,9 +967,9 @@ static VALUE
vm_throw(rb_thread_t *th, rb_control_frame_t *reg_cfp,
rb_num_t throw_state, VALUE throwobj)
{
- const int state = (int)(throw_state & 0xff);
- const int flag = (int)(throw_state & 0x8000);
- const rb_num_t level = throw_state >> 16;
+ const int state = (int)(throw_state & VM_THROW_STATE_MASK);
+ const int flag = (int)(throw_state & VM_THROW_NO_ESCAPE_FLAG);
+ const rb_num_t level = throw_state >> VM_THROW_LEVEL_SHIFT;
if (state != 0) {
return vm_throw_start(th, reg_cfp, state, flag, level, throwobj);