diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-04-04 22:24:29 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2021-04-04 22:24:29 +0000 |
commit | 43449fb9956d568800ed62b326e478b027efe579 (patch) | |
tree | 94d09f7bdae4d5458febc37d053e62ee8148d31d /eval_error.c | |
parent | f56a213a99655616a21ace3b354aa868ca2dff70 (diff) |
merge revision(s) 579645d9: [Backport #17033]
Fixed infinite loop at error in printing cause [Bug #17033]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_6@67913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_error.c')
-rw-r--r-- | eval_error.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/eval_error.c b/eval_error.c index 8ea58a4742..c2d33ef498 100644 --- a/eval_error.c +++ b/eval_error.c @@ -308,6 +308,7 @@ rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo) volatile uint8_t raised_flag = ec->raised_flag; volatile VALUE errat = Qundef; volatile VALUE emesg = Qundef; + volatile bool written = false; if (NIL_P(errinfo)) return; @@ -322,7 +323,10 @@ rb_ec_error_print(rb_execution_context_t * volatile ec, volatile VALUE errinfo) emesg = rb_get_message(errinfo); } - rb_error_write(errinfo, emesg, errat, Qnil, Qnil, Qnil); + if (!written) { + written = true; + rb_error_write(errinfo, emesg, errat, Qnil, Qnil, Qfalse); + } EC_POP_TAG(); ec->errinfo = errinfo; |