summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-12-21 21:02:43 -0800
committerGitHub <noreply@github.com>2022-12-21 21:02:43 -0800
commit4213f42555a62b565ff99e0ad3e7d3c7f5495180 (patch)
treec93d6d18f54330d7b3a6a08f75b76f808a77acf2 /vm_trace.c
parentae455a129e97709d7fd8b11c1e5c3245f4738528 (diff)
downloadruby-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.c5
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)) {