diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-10-31 09:38:35 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-10-31 12:07:54 -0400 |
commit | e2d950733ee274e577813b5a4e930f617c60634f (patch) | |
tree | 9730fe2aa1bf7bc774f636fba19db86a72794b9e /ractor.c | |
parent | 1c45124c497089fa310c13ee4b9ea1d3ec2c2ca8 (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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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]); } } } |