From db897cc318afd4f45ded26e64afa125ee692d4c0 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sun, 10 Sep 2017 05:44:27 +0000 Subject: revert r59815 partially. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 2 -- test/ruby/test_gc.rb | 23 ----------------------- 2 files changed, 25 deletions(-) diff --git a/gc.c b/gc.c index 48658feb1b..93caae5739 100644 --- a/gc.c +++ b/gc.c @@ -2734,14 +2734,12 @@ run_finalizer(rb_objspace_t *objspace, VALUE obj, VALUE table) } saved; rb_thread_t *const th = GET_THREAD(); #define RESTORE_FINALIZER() (\ - th->cfp = saved.cfp, \ rb_set_safe_level_force(saved.safe), \ rb_set_errinfo(saved.errinfo)) saved.safe = rb_safe_level(); saved.errinfo = rb_errinfo(); saved.objid = nonspecial_obj_id(obj); - saved.cfp = th->cfp; saved.finished = 0; TH_PUSH_TAG(th); diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb index 5b85d3d8d9..a5fd2897a2 100644 --- a/test/ruby/test_gc.rb +++ b/test/ruby/test_gc.rb @@ -397,27 +397,4 @@ class TestGc < Test::Unit::TestCase ObjectSpace.each_object{|o| case o when Module then o.instance_methods end} end end - - def test_exception_in_finalizer_method - @result = [] - def self.c1(x) - @result << :c1 - raise - end - def self.c2(x) - @result << :c2 - raise - end - tap { - tap { - obj = Object.new - ObjectSpace.define_finalizer(obj, method(:c1)) - ObjectSpace.define_finalizer(obj, method(:c2)) - obj = nil - } - } - GC.start - skip "finalizers did not get run" if @result.empty? - assert_equal([:c1, :c2], @result) - end end -- cgit v1.2.3