diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-08-26 09:19:07 +0200 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-08-26 13:44:59 +0200 |
| commit | 14bdf4b57dcd3169a8717dc893fd1e1be897deeb (patch) | |
| tree | cf7e21a3c2f7d6bd9fa53788b3bbecd2c2a3ea80 /shape.c | |
| parent | 59c996797e16f45a3b91baa04083c2da3a1edfcb (diff) | |
Ensure T_OBJECT and T_IMEMO/fields have identical layout
Diffstat (limited to 'shape.c')
| -rw-r--r-- | shape.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1270,6 +1270,11 @@ rb_shape_verify_consistency(VALUE obj, shape_id_t shape_id) // Make sure SHAPE_ID_HAS_IVAR_MASK is valid. if (rb_shape_too_complex_p(shape_id)) { RUBY_ASSERT(shape_id & SHAPE_ID_HAS_IVAR_MASK); + + // Ensure complex object don't appear as embedded + if (RB_TYPE_P(obj, T_OBJECT) || IMEMO_TYPE_P(obj, imemo_fields)) { + RUBY_ASSERT(!FL_TEST_RAW(obj, ROBJECT_EMBED)); + } } else { attr_index_t ivar_count = RSHAPE_LEN(shape_id); |
