diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-19 14:10:58 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-12-20 14:12:38 +0900 |
commit | 2e7e153a2af1456515d43b6381e38534b069b1c2 (patch) | |
tree | a7c1730d6b86170e9e80f2e9705ea824ed517829 /error.c | |
parent | 18ba89093a0b214cd89f1567c037c239f094496d (diff) |
[Bug #19242] Prohibit circular causes to be loaded
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6960
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2959,6 +2959,8 @@ ivar_copy_i(st_data_t key, st_data_t val, st_data_t exc) return ST_CONTINUE; } +void rb_exc_check_circular_cause(VALUE exc); + static VALUE exception_loader(VALUE exc, VALUE obj) { @@ -2973,6 +2975,8 @@ exception_loader(VALUE exc, VALUE obj) rb_ivar_foreach(obj, ivar_copy_i, exc); + rb_exc_check_circular_cause(exc); + if (rb_attr_get(exc, id_bt) == rb_attr_get(exc, id_bt_locations)) { rb_ivar_set(exc, id_bt_locations, Qnil); } |