summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2024-01-18 11:48:46 +0900
committernagachika <nagachika@ruby-lang.org>2024-01-18 11:48:46 +0900
commit0cc0e43745ffc13a596441adccee295274d99a0b (patch)
tree83220c77a06e44aa9e8dc10310d2d1dc22d9078e /test/ruby
parent3bd9adadbe0b500cf7e910c99db97aaddfba3369 (diff)
merge revision(s) f9a48548cf3ef54fc0a385ccd78c708737055ecc: [Backport #20042]
restore the stack pointer on finalizer When error on finalizer, the exception will be ignored. To restart the code, we need to restore the stack pointer. fix [Bug #20042] --- gc.c | 4 ++++ test/ruby/test_gc.rb | 9 +++++++++ 2 files changed, 13 insertions(+)
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_gc.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 4251321119..bb136656ce 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -609,6 +609,15 @@ class TestGc < Test::Unit::TestCase
obj = nil
end
end;
+
+ assert_normal_exit "#{<<~"begin;"}\n#{<<~'end;'}", '[Bug #20042]'
+ begin;
+ def (f = Object.new).call = nil # missing ID
+ o = Object.new
+ ObjectSpace.define_finalizer(o, f)
+ o = nil
+ GC.start
+ end;
end
def test_object_ids_never_repeat