diff options
author | Peter Zhu <[email protected]> | 2023-01-04 13:15:59 -0500 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-01-04 14:59:40 -0500 |
commit | 837ef8911c638c3e2bdb6af710de7c1fac7b5f90 (patch) | |
tree | e2f08ba8b9dbc089210762a0363ed0eb81332ba0 /vm_trace.c | |
parent | f7243d1afb726848fc5fa77dbb7c95eb78f6f610 (diff) |
Fix crash in TracePoint c_call for removed method
trace_arg->id is the ID of the original method of an aliased method. If
the original method is removed, then the lookup will fail. We should use
trace_arg->called_id instead, which is the ID of the aliased method.
Fixes [Bug #19305]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7064
Diffstat (limited to 'vm_trace.c')
-rw-r--r-- | vm_trace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_trace.c b/vm_trace.c index 3051266c57..20fade5fd9 100644 --- a/vm_trace.c +++ b/vm_trace.c @@ -915,7 +915,7 @@ rb_tracearg_parameters(rb_trace_arg_t *trace_arg) if (trace_arg->klass && trace_arg->id) { const rb_method_entry_t *me; VALUE iclass = Qnil; - me = rb_method_entry_without_refinements(trace_arg->klass, trace_arg->id, &iclass); + me = rb_method_entry_without_refinements(trace_arg->klass, trace_arg->called_id, &iclass); return rb_unnamed_parameters(rb_method_entry_arity(me)); } break; |