mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
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
This commit is contained in:
parent
a7c7cfb874
commit
aa2b32ae4b
3 changed files with 35 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue