From fd4df3be5c67859e043a58211c87731b25f78ee6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 28 Jun 2014 04:58:53 +0000 Subject: 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 --- eval.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index ad7f1a5..fbe17d0 100644 --- a/eval.c +++ b/eval.c @@ -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(); -- cgit v1.1