ruby-changes:53366
From: nagachika <ko1@a...>
Date: Wed, 7 Nov 2018 00:52:21 +0900 (JST)
Subject: [ruby-changes:53366] nagachika:r65582 (ruby_2_5): merge revision(s) 65554: [Backport #15282]
nagachika 2018-11-07 00:52:16 +0900 (Wed, 07 Nov 2018) New Revision: 65582 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65582 Log: merge revision(s) 65554: [Backport #15282] Don't set throw data as cause [Bug #15282] Modified directories: branches/ruby_2_5/ Modified files: branches/ruby_2_5/eval.c branches/ruby_2_5/test/ruby/test_exception.rb branches/ruby_2_5/version.h Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 65581) +++ ruby_2_5/version.h (revision 65582) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.4" #define RUBY_RELEASE_DATE "2018-11-07" -#define RUBY_PATCHLEVEL 110 +#define RUBY_PATCHLEVEL 111 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 11 Index: ruby_2_5/eval.c =================================================================== --- ruby_2_5/eval.c (revision 65581) +++ ruby_2_5/eval.c (revision 65582) @@ -516,7 +516,7 @@ setup_exception(rb_execution_context_t * https://github.com/ruby/ruby/blob/trunk/ruby_2_5/eval.c#L516 mesg = rb_obj_dup(mesg); } } - if (cause != Qundef) { + if (cause != Qundef && !THROW_DATA_P(cause)) { exc_setup_cause(mesg, cause); } if (NIL_P(bt)) { Index: ruby_2_5/test/ruby/test_exception.rb =================================================================== --- ruby_2_5/test/ruby/test_exception.rb (revision 65581) +++ ruby_2_5/test/ruby/test_exception.rb (revision 65582) @@ -698,6 +698,12 @@ end.join https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_exception.rb#L698 assert_same(a, e.cause.cause) end + def test_cause_at_end + assert_in_out_err([], <<-'end;', [], [/-: unexpected return\n/, /.*undefined local variable or method `n'.*\n/]) + END{n}; END{return} + end; + end + def test_raise_with_cause msg = "[Feature #8257]" cause = ArgumentError.new("foobar") Index: ruby_2_5 =================================================================== --- ruby_2_5 (revision 65581) +++ ruby_2_5 (revision 65582) Property changes on: ruby_2_5 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r65554 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/