summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 06:36:51 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-06 06:36:51 +0000
commit09821dd2a5b59024976b01ac7aa445b6fc14b681 (patch)
tree3416c5fecbad301c2d88094609e91aec94a52172 /compile.c
parentb11b804f8f4c84c7f5d59dd215e3d8a3d4d9d889 (diff)
Fix TracePoint for nested iseq loaded from binary [Bug#14702]
When loading iseq from binary while a TracePoint is on, we need to recompile instructions to their "trace_" variant. Before this commit we only recompiled instructions in the top level iseq, which meant that TracePoint was malfunctioning for code inside module/class/method definitions. * compile.c: Move rb_iseq_init_trace to rb_ibf_load_iseq_complete. It is called on all iseqs during loading. * test_iseq.rb: Test that tracepoints fire within children iseq when using load_from_binary. This patch is from: Alan Wu <XrXr@users.noreply.github.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 1109e4faa7..9e5c05397d 100644
--- a/compile.c
+++ b/compile.c
@@ -9891,6 +9891,7 @@ rb_ibf_load_iseq_complete(rb_iseq_t *iseq)
ibf_load_iseq_each(load, iseq, offset);
ISEQ_COMPILE_DATA_CLEAR(iseq);
FL_UNSET(iseq, ISEQ_NOT_LOADED_YET);
+ rb_iseq_init_trace(iseq);
load->iseq = prev_src_iseq;
}
@@ -10039,8 +10040,6 @@ rb_iseq_ibf_load(VALUE str)
ibf_load_setup(load, loader_obj, str);
iseq = ibf_load_iseq(load, 0);
- rb_iseq_init_trace(iseq);
-
RB_GC_GUARD(loader_obj);
return iseq;
}