Skip to content

Commit

Permalink
merge revision(s) 65554: [Backport #15282]
Browse files Browse the repository at this point in the history
	Don't set throw data as cause [Bug #15282]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@65582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagachika committed Nov 6, 2018
1 parent 218ac97 commit 783f1b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eval.c
Expand Up @@ -516,7 +516,7 @@ setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE
mesg = rb_obj_dup(mesg);
}
}
if (cause != Qundef) {
if (cause != Qundef && !THROW_DATA_P(cause)) {
exc_setup_cause(mesg, cause);
}
if (NIL_P(bt)) {
Expand Down
6 changes: 6 additions & 0 deletions test/ruby/test_exception.rb
Expand Up @@ -698,6 +698,12 @@ def test_cause_at_raised
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")
Expand Down
2 changes: 1 addition & 1 deletion version.h
@@ -1,6 +1,6 @@
#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
Expand Down

0 comments on commit 783f1b2

Please sign in to comment.