diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-11 08:03:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-11 08:03:43 +0000 |
commit | f24fe0566fde8bca3e2cc3d72419d987ef2e3f69 (patch) | |
tree | 8f716d6df2b6a4e00349b9c4d7958a94d02cc3b1 /test | |
parent | cbb8a1166d379c8b609770810adbd4afcb451632 (diff) | |
download | ruby-f24fe0566fde8bca3e2cc3d72419d987ef2e3f69.tar.gz |
eval_error.c: fix loop on exception in message
* error.c (rb_get_message): accessor to the message.
* eval_error.c (rb_ec_error_print): handle exceptions on fetching
the message. [Bug #14566]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_exception.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb index 61521cbfff..43115de3bd 100644 --- a/test/ruby/test_exception.rb +++ b/test/ruby/test_exception.rb @@ -1309,4 +1309,15 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status| assert_operator(message, :end_with?, top) end end + + def test_exception_in_message + code = "#{<<~"begin;"}\n#{<<~'end;'}" + begin; + class Bug14566 < StandardError + def message; raise self.class; end + end + raise Bug14566 + end; + assert_in_out_err([], code, [], /Bug14566/, success: false, timeout: 1) + end end |