aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-10-31 09:38:35 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-10-31 12:07:54 -0400
commite2d950733ee274e577813b5a4e930f617c60634f (patch)
tree9730fe2aa1bf7bc774f636fba19db86a72794b9e /vm_insnhelper.c
parent1c45124c497089fa310c13ee4b9ea1d3ec2c2ca8 (diff)
downloadruby-e2d950733ee274e577813b5a4e930f617c60634f.tar.gz
Add ST table to gen_ivtbl for complex shapes
On 32-bit systems, we must store the shape ID in the gen_ivtbl to not lose the shape. If we directly store the ST table into the generic ivar table, then we lose the shape. This makes it impossible to determine the shape of the object and whether it is too complex or not.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 1e514b7008..6b354dd19a 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1227,7 +1227,7 @@ vm_getivar(VALUE obj, ID id, const rb_iseq_t *iseq, IVC ic, const struct rb_call
#if !SHAPE_IN_BASIC_FLAGS
shape_id = ivtbl->shape_id;
#endif
- ivar_list = ivtbl->ivptr;
+ ivar_list = ivtbl->as.shape.ivptr;
}
else {
return default_value;
@@ -1456,7 +1456,7 @@ vm_setivar_default(VALUE obj, ID id, VALUE val, shape_id_t dest_shape_id, attr_i
return Qundef;
}
- VALUE *ptr = ivtbl->ivptr;
+ VALUE *ptr = ivtbl->as.shape.ivptr;
RB_OBJ_WRITE(obj, &ptr[index], val);