diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-21 11:12:39 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-21 11:12:39 +0000 |
commit | 1729243bba6e3bab8001c3f96bff0aeca47ed9ae (patch) | |
tree | b39f1d7b2287caaddff7f1c11dddd9372a38c54b /eval.c | |
parent | de59178aaf171674a3c2c06cc6271a673a3f9035 (diff) |
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/trunk@57137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -457,6 +457,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; } |