summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <[email protected]>2025-05-01 12:13:31 -0700
committerAaron Patterson <[email protected]>2025-05-15 14:19:48 -0700
commit55c9c75b4788f6411bfa14f0e7d462d06850f60d (patch)
treed1dc1096542557f4d7cecba54e8869c34543ca7e
parent04f538c1441e65def90d5b4224010e7d4f4ffab3 (diff)
Maintain same behavior regardless of tracepoint state
Always use opt_new behavior regardless of tracepoint state.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/13232
-rw-r--r--insns.def2
-rw-r--r--test/ruby/test_settracefunc.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/insns.def b/insns.def
index ba71e9f856..aaa8ec8f5d 100644
--- a/insns.def
+++ b/insns.def
@@ -919,7 +919,7 @@ opt_new
// The bookkeeping slot should be empty.
RUBY_ASSERT(TOPN(argc + 1) == Qnil);
- if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw) && !(ruby_vm_event_flags & ISEQ_TRACE_EVENTS)) {
+ if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw)) {
RB_DEBUG_COUNTER_INC(opt_new_hit);
val = rb_obj_alloc(val);
TOPN(argc) = val;
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb
index 55c07abbea..fac6dd8185 100644
--- a/test/ruby/test_settracefunc.rb
+++ b/test/ruby/test_settracefunc.rb
@@ -1999,7 +1999,7 @@ CODE
TracePoint.new(:c_call, &capture_events).enable{
c.new
}
- assert_equal [:c_call, :itself, :initialize], events[1]
+ assert_equal [:c_call, :itself, :initialize], events[0]
events.clear
o = Class.new{