From 33cf8f640bab35c463186ef0856689c22559fbeb Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 8 Dec 2023 15:17:51 -0500 Subject: Make WeakMap safe for compaction during allocation During allocation, the table may not have been allocated yet which would crash in the st_foreach. --- test/ruby/test_weakmap.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_weakmap.rb b/test/ruby/test_weakmap.rb index a30004bce3..0371afa77a 100644 --- a/test/ruby/test_weakmap.rb +++ b/test/ruby/test_weakmap.rb @@ -237,6 +237,10 @@ class TestWeakMap < Test::Unit::TestCase end; end + def test_gc_compact_stress + EnvUtil.under_gc_compact_stress { ObjectSpace::WeakMap.new } + end + def test_replaced_values_bug_19531 a = "A".dup b = "B".dup -- cgit v1.2.3