diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-05-15 12:14:53 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-05-15 16:06:52 +0200 |
| commit | 60ffb714d251878753ebf66e68149311c728cac6 (patch) | |
| tree | d9cb46a81af9313ad6faa6faa559fd1c4c7c2c66 /eval.c | |
| parent | ed632cd0bacc710b03809c903a978d3fa2cfedfe (diff) | |
Ensure shape_id is never used on T_IMEMO
It doesn't make sense to set ivars or anything shape
related on a T_IMEMO.
Co-Authored-By: John Hawthorn <john@hawthorn.email>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13347
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -529,10 +529,14 @@ exc_setup_message(const rb_execution_context_t *ec, VALUE mesg, VALUE *cause) rb_exc_check_circular_cause(*cause); #else VALUE c = *cause; - while (!NIL_P(c = rb_attr_get(c, id_cause))) { + while (!NIL_P(c)) { if (c == mesg) { rb_raise(rb_eArgError, "circular causes"); } + if (THROW_DATA_P(c)) { + break; + } + c = rb_attr_get(c, id_cause); } #endif } |
