ruby-changes:47699
From: nagachika <ko1@a...>
Date: Sun, 10 Sep 2017 14:36:15 +0900 (JST)
Subject: [ruby-changes:47699] nagachika:r59815 (ruby_2_4): bump up RUBY_PATCHLEVEL
nagachika 2017-09-10 14:36:09 +0900 (Sun, 10 Sep 2017) New Revision: 59815 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59815 Log: bump up RUBY_PATCHLEVEL Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/gc.c branches/ruby_2_4/test/ruby/test_gc.rb branches/ruby_2_4/version.h Index: ruby_2_4/test/ruby/test_gc.rb =================================================================== --- ruby_2_4/test/ruby/test_gc.rb (revision 59814) +++ ruby_2_4/test/ruby/test_gc.rb (revision 59815) @@ -397,4 +397,27 @@ 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/version.h =================================================================== --- ruby_2_4/version.h (revision 59814) +++ ruby_2_4/version.h (revision 59815) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.2" #define RUBY_RELEASE_DATE "2017-09-10" -#define RUBY_PATCHLEVEL 189 +#define RUBY_PATCHLEVEL 190 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 9 Index: ruby_2_4/gc.c =================================================================== --- ruby_2_4/gc.c (revision 59814) +++ ruby_2_4/gc.c (revision 59815) @@ -2728,17 +2728,20 @@ run_finalizer(rb_objspace_t *objspace, V https://github.com/ruby/ruby/blob/trunk/ruby_2_4/gc.c#L2728 volatile struct { VALUE errinfo; VALUE objid; + rb_control_frame_t *cfp; long finished; int safe; } 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); Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 59814) +++ ruby_2_4 (revision 59815) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r59649 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/