summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 11:39:47 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-27 11:39:47 +0000
commit9d693b181ce3bbd7553be36f604f5b694f8e9fea (patch)
treef216f077c57d7b13c64ae36b3acff6614c54b015 /eval.c
parentf82b0a39eaa1ac262db0093f441289678530e351 (diff)
merge revision(s) 57137: [Backport #13043]
eval.c: fix circular cause * eval.c (exc_setup_cause): always set cause of cause to get rid of circular references. [ruby-core:78688] [Bug #13043] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@57222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/eval.c b/eval.c
index fbd28565ed..a8935ff7ce 100644
--- a/eval.c
+++ b/eval.c
@@ -468,6 +468,9 @@ exc_setup_cause(VALUE exc, VALUE cause)
#endif
if (!NIL_P(cause) && cause != exc) {
rb_ivar_set(exc, id_cause, cause);
+ if (!rb_ivar_defined(cause, id_cause)) {
+ rb_ivar_set(cause, id_cause, Qnil);
+ }
}
return exc;
}