From e210b899dc803607bef1b395ace02dc9f96554ea Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 16 Aug 2023 20:28:33 -0700 Subject: Move the PC regardless of the leaf flag (#8232) Co-authored-by: Alan Wu --- test/objspace/test_objspace.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 7edf6be930..43ccac7920 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -225,6 +225,13 @@ class TestObjSpace < Test::Unit::TestCase assert_equal(__FILE__, ObjectSpace.allocation_sourcefile(o4)) assert_equal(line4, ObjectSpace.allocation_sourceline(o4)) + # The line number should be based on newarray instead of getinstancevariable. + line5 = __LINE__; o5 = [ # newarray (leaf) + @ivar, # getinstancevariable (not leaf) + ] + assert_equal(__FILE__, ObjectSpace.allocation_sourcefile(o5)) + assert_equal(line5, ObjectSpace.allocation_sourceline(o5)) + # [Bug #19482] EnvUtil.under_gc_stress do 100.times do -- cgit v1.2.3