diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-12-08 12:24:37 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-12-08 16:59:52 -0500 |
commit | 82bb9cedd3fb41fd78d612153c35fdb8c5344d5a (patch) | |
tree | 06914a3fddbaffa8e436a0a31b4c8df2541f4a51 /bootstraptest/test_yjit.rb | |
parent | c47e821b8928b1a8755dc8693ffce57342c10868 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5229
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r-- | bootstraptest/test_yjit.rb | 12 |
1 files changed, 12 insertions, 0 deletions
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") |