summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 357a85d589..b172c2d20f 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -3729,9 +3729,16 @@ vm_trace(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, const VALUE *p
{
const rb_iseq_t *iseq = reg_cfp->iseq;
size_t pos = pc - iseq->body->iseq_encoded;
+ rb_event_flag_t cur_event_flags = ruby_vm_event_flags;
rb_event_flag_t events = rb_iseq_event_flags(iseq, pos);
rb_event_flag_t event;
+ if ((events & cur_event_flags) == 0) {
+ /* disable trace */
+ rb_iseq_trace_set(iseq, cur_event_flags);
+ return;
+ }
+
if (ec->trace_arg != NULL) return;
if (0) {