summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-08-16 20:28:33 -0700
committerGitHub <noreply@github.com>2023-08-16 20:28:33 -0700
commite210b899dc803607bef1b395ace02dc9f96554ea (patch)
treeb0894c7fdeda458d06eb69fef9593edb360de1b7 /test
parent5bb946228550c7f171c27725860b153a675404f3 (diff)
Move the PC regardless of the leaf flag (#8232)
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Notes
Notes: Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/objspace/test_objspace.rb7
1 files changed, 7 insertions, 0 deletions
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