aboutsummaryrefslogtreecommitdiffstats
path: root/vm_trace.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-07-08 18:23:39 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2022-06-22 08:30:39 -0400
commit744d17ff6c33b09334508e8110007ea2a82252f5 (patch)
tree38579b596f6d2fea31a85864f75ce3d874968cbf /vm_trace.c
parente6f92cada1cf8026d0dc6dbd11867ba9a994f4d6 (diff)
downloadruby-744d17ff6c33b09334508e8110007ea2a82252f5.tar.gz
Fix infinite loop when b_return TracePoint throws
Previously, we didn't pop the frame that runs the TracePoint hook for b_return events for blocks running as methods (bmethods). In case the hook raises, that formed an infinite loop during stack unwinding in hook_before_rewind(). [Bug #18060]
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_trace.c b/vm_trace.c
index 7f65f98695..51b815c54a 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -390,6 +390,7 @@ exec_hooks_protected(rb_execution_context_t *ec, rb_hook_list_t *list, const rb_
return state;
}
+// pop_p: Whether to pop the frame for the TracePoint when it throws.
MJIT_FUNC_EXPORTED void
rb_exec_event_hooks(rb_trace_arg_t *trace_arg, rb_hook_list_t *hooks, int pop_p)
{