summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2023-10-30 14:55:13 +0100
committerPeter Zhu <peter@peterzhu.ca>2023-10-31 12:07:54 -0400
commitac7f913ca3af970225c9cc93b92eb5c403894180 (patch)
tree181136e97e58eff8f672684d475ed38dd9362a07 /variable.c
parent4aacc559d99988f395eced3534c7a6938bd356c8 (diff)
Handle SHAPE_TOO_COMPLEX in `generic_ivar_set`
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/variable.c b/variable.c
index b5d730ec9a..34934a7b84 100644
--- a/variable.c
+++ b/variable.c
@@ -1484,6 +1484,11 @@ generic_ivar_set(VALUE obj, ID id, VALUE val)
attr_index_t index;
// The returned shape will have `id` in its iv_table
rb_shape_t *shape = rb_shape_get_shape(obj);
+ if (UNLIKELY(shape->type == SHAPE_OBJ_TOO_COMPLEX)) {
+ rb_complex_ivar_set(obj, id, val);
+ return;
+ }
+
bool found = rb_shape_get_iv_index(shape, id, &index);
rb_shape_t *next_shape = shape;
if (!found) {