summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-04-01 07:22:49 -0700
committerJeremy Evans <code@jeremyevans.net>2022-04-01 07:22:49 -0700
commitd1d48cb690fdad855da94b2a2d11721428bc06ba (patch)
tree156fcb356f2b4206a93f374c281449a7f3fe41c2 /vm_trace.c
parentd8352ff3ac6960f029e3c9253f527f6e4a845645 (diff)
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
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c9
1 files changed, 1 insertions, 8 deletions
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);