From d1d48cb690fdad855da94b2a2d11721428bc06ba Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Fri, 1 Apr 2022 07:22:49 -0700 Subject: Revert "Raise RuntimeError if Kernel#binding is called from a non-Ruby frame" This reverts commit 343ea9967e4a6b279eed6bd8e81ad0bdc747f254. This causes an assertion failure with -DRUBY_DEBUG=1 -DRGENGC_CHECK_MODE=2 --- vm_trace.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'vm_trace.c') diff --git a/vm_trace.c b/vm_trace.c index aaa70d3ef0..653e9a510a 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -721,14 +721,7 @@ call_trace_func(rb_event_flag_t event, VALUE proc, VALUE self, ID id, VALUE klas argv[1] = filename; argv[2] = INT2FIX(line); argv[3] = id ? ID2SYM(id) : Qnil; - argv[4] = Qnil; - if (self && (filename != Qnil) && - event != RUBY_EVENT_C_CALL && - event != RUBY_EVENT_C_RETURN && - (VM_FRAME_RUBYFRAME_P(ec->cfp) || - VM_FRAME_RUBYFRAME_P(RUBY_VM_PREVIOUS_CONTROL_FRAME(ec->cfp)))) { - argv[4] = rb_binding_new(); - } + argv[4] = (self && (filename != Qnil)) ? rb_binding_new() : Qnil; argv[5] = klass ? klass : Qnil; rb_proc_call_with_block(proc, 6, argv, Qnil); -- cgit v1.2.3