summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-28 04:58:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-28 04:58:53 +0000
commitfd4df3be5c67859e043a58211c87731b25f78ee6 (patch)
treed2ecc9da7245e6a9bc76cf4151bab7aef39fe2cb /eval.c
parent3ff85b795ac42976e5ed51c6add0b18660455abd (diff)
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.c14
1 files changed, 8 insertions, 6 deletions
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();