From 60e207b47f377b04d11df9a9dbb0548a578c2776 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 31 Oct 2023 17:01:28 -0400 Subject: [PATCH] Fix SystemStackError for test_run_out_of_shape_for_class --- test/ruby/test_shapes.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)