Skip to content

Commit 55c9c75

Browse files
committed
Maintain same behavior regardless of tracepoint state
Always use opt_new behavior regardless of tracepoint state.
1 parent 04f538c commit 55c9c75

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

insns.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ opt_new
919919
// The bookkeeping slot should be empty.
920920
RUBY_ASSERT(TOPN(argc + 1) == Qnil);
921921

922-
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw) && !(ruby_vm_event_flags & ISEQ_TRACE_EVENTS)) {
922+
if (vm_method_cfunc_is(GET_ISEQ(), cd, val, rb_class_new_instance_pass_kw)) {
923923
RB_DEBUG_COUNTER_INC(opt_new_hit);
924924
val = rb_obj_alloc(val);
925925
TOPN(argc) = val;

test/ruby/test_settracefunc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,7 @@ def m
19991999
TracePoint.new(:c_call, &capture_events).enable{
20002000
c.new
20012001
}
2002-
assert_equal [:c_call, :itself, :initialize], events[1]
2002+
assert_equal [:c_call, :itself, :initialize], events[0]
20032003
events.clear
20042004

20052005
o = Class.new{

0 commit comments

Comments
 (0)