summaryrefslogtreecommitdiff
path: root/ractor.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 /ractor.c
parent1c45124c497089fa310c13ee4b9ea1d3ec2c2ca8 (diff)
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 'ractor.c')
-rw-r--r--ractor.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ractor.c b/ractor.c
index b4787e7a01..db2d43e91e 100644
--- a/ractor.c
+++ b/ractor.c
@@ -2758,8 +2758,8 @@ obj_traverse_i(VALUE obj, struct obj_traverse_data *data)
if (UNLIKELY(FL_TEST_RAW(obj, FL_EXIVAR))) {
struct gen_ivtbl *ivtbl;
rb_ivar_generic_ivtbl_lookup(obj, &ivtbl);
- for (uint32_t i = 0; i < ivtbl->numiv; i++) {
- VALUE val = ivtbl->ivptr[i];
+ for (uint32_t i = 0; i < ivtbl->as.shape.numiv; i++) {
+ VALUE val = ivtbl->as.shape.ivptr[i];
if (!UNDEF_P(val) && obj_traverse_i(val, data)) return 1;
}
}
@@ -3229,9 +3229,9 @@ obj_traverse_replace_i(VALUE obj, struct obj_traverse_replace_data *data)
if (UNLIKELY(FL_TEST_RAW(obj, FL_EXIVAR))) {
struct gen_ivtbl *ivtbl;
rb_ivar_generic_ivtbl_lookup(obj, &ivtbl);
- for (uint32_t i = 0; i < ivtbl->numiv; i++) {
- if (!UNDEF_P(ivtbl->ivptr[i])) {
- CHECK_AND_REPLACE(ivtbl->ivptr[i]);
+ for (uint32_t i = 0; i < ivtbl->as.shape.numiv; i++) {
+ if (!UNDEF_P(ivtbl->as.shape.ivptr[i])) {
+ CHECK_AND_REPLACE(ivtbl->as.shape.ivptr[i]);
}
}
}