1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@67233 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2019-03-12 21:05:56 +00:00
parent a648423e27
commit c4baab0779
3 changed files with 26 additions and 3 deletions

1
eval.c
View file

@ -175,6 +175,7 @@ ruby_cleanup(volatile int ex)
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)]);

View file

@ -154,4 +154,26 @@ class TestBeginEndBlock < Test::Unit::TestCase
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

View file

@ -1,10 +1,10 @@
#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"