diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-28 02:27:47 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-28 02:27:47 +0000 |
commit | 5286a89624855418c548c4b5e60bc67e4b07f380 (patch) | |
tree | 6ecab3b164dbae6406de928e42ec7ca43141d6ba | |
parent | 6592dca931e13679a28353e3e1f77f3e1d32ad4c (diff) | |
download | ruby-5286a89624855418c548c4b5e60bc67e4b07f380.tar.gz |
check ruby_vm_event_flags everytime.
* vm_insnhelper.c (vm_trace): use EXEC_EVENT_HOOK() instead of
EXEC_EVENT_HOOK_VM_TRACE(). The latter macro assumes
`ruby_vm_event_flags` is constant in `vm_trace()` function,
but it can be changed in hook functions.
* vm_core.h (EXEC_EVENT_HOOK_VM_TRACE): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | vm_core.h | 3 | ||||
-rw-r--r-- | vm_insnhelper.c | 6 |
2 files changed, 3 insertions, 6 deletions
@@ -1741,9 +1741,6 @@ rb_exec_event_hook_orig(rb_execution_context_t *ec, const rb_event_flag_t flag, #define EXEC_EVENT_HOOK(ec_, flag_, self_, id_, called_id_, klass_, data_) \ EXEC_EVENT_HOOK_ORIG(ec_, flag_, ruby_vm_event_flags, self_, id_, called_id_, klass_, data_, 0) -#define EXEC_EVENT_HOOK_VM_TRACE(ec_, flag_, vm_flag_, self_, id_, called_id_, klass_, data_) \ - EXEC_EVENT_HOOK_ORIG(ec_, flag_, vm_flag_, self_, id_, called_id_, klass_, data_, 0) - #define EXEC_EVENT_HOOK_AND_POP_FRAME(ec_, flag_, self_, id_, called_id_, klass_, data_) \ EXEC_EVENT_HOOK_ORIG(ec_, flag_, ruby_vm_event_flags, self_, id_, called_id_, klass_, data_, 1) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index f48cae45ae..3c08a74f09 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -3761,13 +3761,13 @@ vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *p event == RUBY_EVENT_B_CALL); reg_cfp->pc++; vm_dtrace(event, ec); - EXEC_EVENT_HOOK_VM_TRACE(ec, event, vm_event_flags, GET_SELF(), 0, 0, 0, Qundef); + EXEC_EVENT_HOOK(ec, event, GET_SELF(), 0, 0, 0, Qundef); reg_cfp->pc--; } if (events & RUBY_EVENT_LINE) { reg_cfp->pc++; vm_dtrace(RUBY_EVENT_LINE, ec); - EXEC_EVENT_HOOK_VM_TRACE(ec, RUBY_EVENT_LINE, vm_event_flags, GET_SELF(), 0, 0, 0, Qundef); + EXEC_EVENT_HOOK(ec, RUBY_EVENT_LINE, GET_SELF(), 0, 0, 0, Qundef); reg_cfp->pc--; } if (event = (events & (RUBY_EVENT_END | RUBY_EVENT_RETURN | RUBY_EVENT_B_RETURN))) { @@ -3776,7 +3776,7 @@ vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *p event == RUBY_EVENT_B_RETURN); reg_cfp->pc++; vm_dtrace(RUBY_EVENT_LINE, ec); - EXEC_EVENT_HOOK_VM_TRACE(ec, event, vm_event_flags, GET_SELF(), 0, 0, 0, TOPN(0)); + EXEC_EVENT_HOOK(ec, event, GET_SELF(), 0, 0, 0, TOPN(0)); reg_cfp->pc--; } } |