From 1b8ff4f799ba47d77b80a48e7504f49ddfd35239 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 20 Jul 2015 00:08:23 +0000 Subject: 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 --- vm_insnhelper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'vm_insnhelper.c') 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); -- cgit v1.2.3