ruby-changes:55026
From: nagachika <ko1@a...>
Date: Wed, 13 Mar 2019 06:06:00 +0900 (JST)
Subject: [ruby-changes:55026] nagachika:r67233 (ruby_2_5): merge revision(s) 67201: [Backport #15650]
nagachika 2019-03-13 06:05:56 +0900 (Wed, 13 Mar 2019) New Revision: 67233 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67233 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_5/ Modified files: branches/ruby_2_5/eval.c branches/ruby_2_5/test/ruby/test_beginendblock.rb branches/ruby_2_5/version.h Index: ruby_2_5/test/ruby/test_beginendblock.rb =================================================================== --- ruby_2_5/test/ruby/test_beginendblock.rb (revision 67232) +++ ruby_2_5/test/ruby/test_beginendblock.rb (revision 67233) @@ -154,4 +154,26 @@ class TestBeginEndBlock < Test::Unit::Te https://github.com/ruby/ruby/blob/trunk/ruby_2_5/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_5/eval.c =================================================================== --- ruby_2_5/eval.c (revision 67232) +++ ruby_2_5/eval.c (revision 67233) @@ -175,6 +175,7 @@ ruby_cleanup(volatile int ex) https://github.com/ruby/ruby/blob/trunk/ruby_2_5/eval.c#L175 step_0: step++; errs[1] = th->ec->errinfo; + if (THROW_DATA_P(th->ec->errinfo)) th->ec->errinfo = Qnil; th->ec->safe_level = 0; ruby_init_stack(&errs[STACK_UPPER(errs, 0, 1)]); Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 67232) +++ ruby_2_5/version.h (revision 67233) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.4" -#define RUBY_RELEASE_DATE "2019-03-12" -#define RUBY_PATCHLEVEL 145 +#define RUBY_RELEASE_DATE "2019-03-13" +#define RUBY_PATCHLEVEL 146 #define RUBY_RELEASE_YEAR 2019 #define RUBY_RELEASE_MONTH 3 -#define RUBY_RELEASE_DAY 12 +#define RUBY_RELEASE_DAY 13 #include "ruby/version.h" Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 67232) +++ ruby_2_5 (revision 67233) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r67201 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/