mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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.
This commit is contained in:
parent
1c45124c49
commit
e2d950733e
5 changed files with 118 additions and 88 deletions
11
variable.h
11
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 **);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue