From 1454906d4e730312b175197182cf85581821ed5e Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 17 Nov 2021 09:07:47 -0500 Subject: [PATCH] Add tests for cme NULL crash Tests for GitHub PR #5122. Originally in GitHub PR #5121. --- test/ruby/test_super.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 3afde9b0e3..6a575b88c5 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -549,7 +549,13 @@ class TestSuper < Test::Unit::TestCase o = b.new o.danger! - 2.times { o.missing rescue NoMethodError } + begin + original_gc_stress = GC.stress + GC.stress = true + 2.times { o.missing rescue NoMethodError } + ensure + GC.stress = original_gc_stress + end end def test_from_eval