summaryrefslogtreecommitdiff
path: root/test/ruby/test_shapes.rb
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-11-01 13:47:26 -0400
committerPeter Zhu <[email protected]>2023-11-01 13:47:26 -0400
commit909afcb4fca393ce75cc63edc7656fd95a64f0f9 (patch)
treea5f7c014026542579708023dc72046d584b19f4d /test/ruby/test_shapes.rb
parent52e127280bacf19f38284c68149351f192e71e5d (diff)
Fix SystemStackError in test_run_out_of_shape_for_class_cvar
Diffstat (limited to 'test/ruby/test_shapes.rb')
-rw-r--r--test/ruby/test_shapes.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_shapes.rb b/test/ruby/test_shapes.rb
index 11eb66e7a3..b052a4a647 100644
--- a/test/ruby/test_shapes.rb
+++ b/test/ruby/test_shapes.rb
@@ -278,13 +278,15 @@ class TestShapes < Test::Unit::TestCase
def test_run_out_of_shape_for_class_cvar
assert_separately([], "#{<<~"begin;"}\n#{<<~'end;'}")
begin;
- c = Class.new
i = 0
while RubyVM::Shape.shapes_available > 0
+ c = Class.new
c.class_variable_set(:"@@i#{i}", 1)
i += 1
end
+ c = Class.new
+
c.class_variable_set(:@@a, 1)
assert_equal(1, c.class_variable_get(:@@a))