diff options
author | Jeremy Evans <code@jeremyevans.net> | 2022-12-21 21:02:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-21 21:02:43 -0800 |
commit | 4213f42555a62b565ff99e0ad3e7d3c7f5495180 (patch) | |
tree | c93d6d18f54330d7b3a6a08f75b76f808a77acf2 /vm_trace.c | |
parent | ae455a129e97709d7fd8b11c1e5c3245f4738528 (diff) | |
download | ruby-4213f42555a62b565ff99e0ad3e7d3c7f5495180.tar.gz |
Make sure TracePoint#binding returns nil for c_call/c_return events
This makes sure the method returns nil for these events, as
described in NEWS, even if the TracePoint could create a binding.
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vm_trace.c b/vm_trace.c index ea1d47361d..69b360dae9 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -961,6 +961,11 @@ VALUE rb_tracearg_binding(rb_trace_arg_t *trace_arg) { rb_control_frame_t *cfp; + switch (trace_arg->event) { + case RUBY_EVENT_C_CALL: + case RUBY_EVENT_C_RETURN: + return Qnil; + } cfp = rb_vm_get_binding_creatable_next_cfp(trace_arg->ec, trace_arg->cfp); if (cfp && imemo_type_p((VALUE)cfp->iseq, imemo_iseq)) { |