diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-28 04:58:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-28 04:58:53 +0000 |
commit | fd4df3be5c67859e043a58211c87731b25f78ee6 (patch) | |
tree | d2ecc9da7245e6a9bc76cf4151bab7aef39fe2cb /eval.c | |
parent | 3ff85b795ac42976e5ed51c6add0b18660455abd (diff) | |
download | ruby-fd4df3be5c67859e043a58211c87731b25f78ee6.tar.gz |
eval.c: no overwrite SystemStackError backtrace
* eval.c (setup_exception): should not overwrite SystemStackError
backtrace if set already. [ruby-core:63377] [Feature #6216]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -493,13 +493,15 @@ setup_exception(rb_thread_t *th, int tag, volatile VALUE mesg, VALUE cause) if (file && !NIL_P(mesg)) { VALUE at; if (sysstack_error_p(mesg)) { - at = rb_vm_backtrace_object(); - if (mesg == sysstack_error) { - VALUE ruby_vm_sysstack_error_copy(void); - mesg = ruby_vm_sysstack_error_copy(); + if (NIL_P(rb_attr_get(mesg, idBt))) { + at = rb_vm_backtrace_object(); + if (mesg == sysstack_error) { + VALUE ruby_vm_sysstack_error_copy(void); + mesg = ruby_vm_sysstack_error_copy(); + } + rb_ivar_set(mesg, idBt, at); + rb_ivar_set(mesg, idBt_locations, at); } - rb_ivar_set(mesg, idBt, at); - rb_ivar_set(mesg, idBt_locations, at); } else if (NIL_P(get_backtrace(mesg))) { at = rb_vm_backtrace_object(); |