Fix SystemStackError for test_run_out_of_shape_for_class

This commit is contained in:
Peter Zhu 2023-10-31 17:01:28 -04:00
parent 8889992b75
commit 60e207b47f

View File

@ -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)