ruby-changes:47700
From: nagachika <ko1@a...>
Date: Sun, 10 Sep 2017 14:44:32 +0900 (JST)
Subject: [ruby-changes:47700] nagachika:r59816 (ruby_2_4): revert r59815 partially.
nagachika 2017-09-10 14:44:27 +0900 (Sun, 10 Sep 2017) New Revision: 59816 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59816 Log: revert r59815 partially. Modified files: branches/ruby_2_4/gc.c branches/ruby_2_4/test/ruby/test_gc.rb Index: ruby_2_4/test/ruby/test_gc.rb =================================================================== --- ruby_2_4/test/ruby/test_gc.rb (revision 59815) +++ ruby_2_4/test/ruby/test_gc.rb (revision 59816) @@ -397,27 +397,4 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_4/test/ruby/test_gc.rb#L397 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 Index: ruby_2_4/gc.c =================================================================== --- ruby_2_4/gc.c (revision 59815) +++ ruby_2_4/gc.c (revision 59816) @@ -2734,14 +2734,12 @@ run_finalizer(rb_objspace_t *objspace, V https://github.com/ruby/ruby/blob/trunk/ruby_2_4/gc.c#L2734 } 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/