diff options
author | nagachika <nagachika@ruby-lang.org> | 2023-03-25 11:04:33 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2023-03-25 11:04:33 +0900 |
commit | 810ae06c06312908fc1a7284773d8a9101ee145b (patch) | |
tree | 5b9dd70da37a85caac30c80e71b5dbc4efd08665 /error.c | |
parent | 8c99882dad0b6fedbd656889829a3780366bd8b6 (diff) |
merge revision(s) 2e7e153a2af1456515d43b6381e38534b069b1c2: [Backport #19242]
[Bug #19242] Prohibit circular causes to be loaded
---
error.c | 4 ++++
eval.c | 4 ++++
eval_error.c | 11 +++++++++++
test/ruby/test_exception.rb | 12 ++++++++++++
4 files changed, 31 insertions(+)
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -2846,6 +2846,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) { @@ -2860,6 +2862,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); } |