diff options
| author | Koichi Sasada <ko1@atdot.net> | 2023-12-19 17:32:19 +0900 |
|---|---|---|
| committer | Koichi Sasada <ko1@atdot.net> | 2023-12-19 17:59:49 +0900 |
| commit | f9a48548cf3ef54fc0a385ccd78c708737055ecc (patch) | |
| tree | 8212edda0b1ca44868328d2dd39099014a59a78e /test/ruby | |
| parent | 96e4f42b3d13f37afce1a8c584a56f6d7e98ec23 (diff) | |
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]
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_gc.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index a577fcb16b..4c4a7f6a27 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -810,6 +810,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 |
