summaryrefslogtreecommitdiff
path: root/test/ruby/test_shapes.rb
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-10-31 17:01:28 -0400
committerPeter Zhu <[email protected]>2023-10-31 17:01:28 -0400
commit60e207b47f377b04d11df9a9dbb0548a578c2776 (patch)
treecd2b06498b3db5a3f083307b7e5214dca7c5e4d2 /test/ruby/test_shapes.rb
parent8889992b75f85c8080fc09c7a3a1cb6123a098c1 (diff)
Fix SystemStackError for test_run_out_of_shape_for_class
Diffstat (limited to 'test/ruby/test_shapes.rb')
-rw-r--r--test/ruby/test_shapes.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb
index 529964729b..56e6ac67eb 100644
--- a/test/ruby/test_shapes.rb
+++ b/test/ruby/test_shapes.rb
@@ -255,13 +255,14 @@ class TestShapes < Test::Unit::TestCase
def test_run_out_of_shape_for_class
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
- c = Class.new
i = 0
while RubyVM::Shape.shapes_available > 0
+ c = Class.new
c.instance_variable_set(:"@i#{i}", 1)
i += 1
end
+ c = Class.new
c.instance_variable_set(:@a, 1)
assert_equal(1, c.instance_variable_get(:@a))
c.remove_instance_variable(:@a)