diff options
author | Kouhei Yanagita <yanagi@shakenbu.org> | 2023-11-22 18:12:23 +0900 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2023-12-12 09:36:37 -0800 |
commit | 06e2fbb8260022de8532d2e940fc69e8ea413679 (patch) | |
tree | d65696ce0fa324f2d00b77cebd532accea61fe4c /vm_trace.c | |
parent | 1f22245ed5004ef097e192aec157b34409214a2a (diff) |
[Bug #19114] Fix for multiple calls of TracePoint#enable
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vm_trace.c b/vm_trace.c index 4b97288f23..6969c8d3ce 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -1197,6 +1197,10 @@ rb_tracepoint_enable(VALUE tpval) rb_raise(rb_eArgError, "can't nest-enable a targeting TracePoint"); } + if (tp->tracing) { + return Qundef; + } + if (tp->target_th) { rb_thread_add_event_hook2(tp->target_th->self, (rb_event_hook_func_t)tp_call_trace, tp->events, tpval, RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG); |