ruby-changes:55002
From: naruse <ko1@a...>
Date: Mon, 11 Mar 2019 16:01:23 +0900 (JST)
Subject: [ruby-changes:55002] naruse:r67209 (ruby_2_6): merge revision(s) 67201: [Backport #15650]
naruse 2019-03-11 16:01:19 +0900 (Mon, 11 Mar 2019) New Revision: 67209 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67209 Log: merge revision(s) 67201: [Backport #15650] eval.c: clear internal errinfo * eval.c (ruby_cleanup): clear internal error info when invoking end procs. [ruby-core:91731] [Bug #15650] Modified directories: branches/ruby_2_6/ Modified files: branches/ruby_2_6/eval.c branches/ruby_2_6/test/ruby/test_beginendblock.rb branches/ruby_2_6/version.h Index: ruby_2_6/eval.c =================================================================== --- ruby_2_6/eval.c (revision 67208) +++ ruby_2_6/eval.c (revision 67209) @@ -188,6 +188,7 @@ ruby_cleanup(volatile int ex) https://github.com/ruby/ruby/blob/trunk/ruby_2_6/eval.c#L188 step_0: step++; errs[1] = th->ec->errinfo; + if (THROW_DATA_P(th->ec->errinfo)) th->ec->errinfo = Qnil; rb_set_safe_level_force(0); ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]); Index: ruby_2_6/version.h =================================================================== --- ruby_2_6/version.h (revision 67208) +++ ruby_2_6/version.h (revision 67209) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_6/version.h#L1 #define RUBY_VERSION "2.6.1" #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 42 +#define RUBY_PATCHLEVEL 43 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_6/test/ruby/test_beginendblock.rb =================================================================== --- ruby_2_6/test/ruby/test_beginendblock.rb (revision 67208) +++ ruby_2_6/test/ruby/test_beginendblock.rb (revision 67209) @@ -154,4 +154,26 @@ class TestBeginEndBlock < Test::Unit::Te https://github.com/ruby/ruby/blob/trunk/ruby_2_6/test/ruby/test_beginendblock.rb#L154 end end; end + + if defined?(fork) + def test_internal_errinfo_at_exit + # TODO: use other than break-in-fork to throw an internal + # error info. + error, pid, status = IO.pipe do |r, w| + pid = fork do + r.close + STDERR.reopen(w) + at_exit do + $!.class + end + break + end + w.close + [r.read, *Process.wait2(pid)] + end + assert_not_predicate(status, :success?) + assert_not_predicate(status, :signaled?) + assert_match(/unexpected break/, error) + end + end end Index: ruby_2_6 =================================================================== --- ruby_2_6 (revision 67208) +++ ruby_2_6 (revision 67209) Property changes on: ruby_2_6 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r67201 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/