From 82bb9cedd3fb41fd78d612153c35fdb8c5344d5a Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Wed, 8 Dec 2021 12:24:37 -0500 Subject: YJIT: Fix leak in compilation loop Previously, when there are too many blocks in a batch, the last block in the batch is not tracked in the array of batches and not freed. --- bootstraptest/test_yjit.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bootstraptest') diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb index e50d78a9dc..2ac37df0a2 100644 --- a/bootstraptest/test_yjit.rb +++ b/bootstraptest/test_yjit.rb @@ -1,3 +1,15 @@ +assert_normal_exit %q{ + # regression test for a leak caught by an asert on --yjit-call-threshold=2 + Foo = 1 + + eval("def foo = [#{(['Foo,']*256).join}]") + + foo + foo + + Object.send(:remove_const, :Foo) +} + assert_equal '[nil, nil, nil, nil, nil, nil]', %q{ [NilClass, TrueClass, FalseClass, Integer, Float, Symbol].each do |klass| klass.class_eval("def foo = @foo") -- cgit v1.2.3