summaryrefslogtreecommitdiff
path: root/variable.h
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 /variable.h
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 'variable.h')
-rw-r--r--variable.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/variable.h b/variable.h
index 5c0366de32..12ada66108 100644
--- a/variable.h
+++ b/variable.h
@@ -16,8 +16,15 @@ struct gen_ivtbl {
#if !SHAPE_IN_BASIC_FLAGS
uint16_t shape_id;
#endif
- uint32_t numiv;
- VALUE ivptr[FLEX_ARY_LEN];
+ union {
+ struct {
+ uint32_t numiv;
+ VALUE ivptr[1];
+ } shape;
+ struct {
+ st_table *table;
+ } complex;
+ } as;
};
int rb_ivar_generic_ivtbl_lookup(VALUE obj, struct gen_ivtbl **);