diff options
author | Jean Boussier <[email protected]> | 2025-06-13 15:22:28 +0200 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2025-06-13 23:50:30 +0200 |
commit | b51078f82ee35d532dfd5b6981733f757d410d79 (patch) | |
tree | b028c5779563fb86ba83ef1c1905d51496da0fc2 /shape.c | |
parent | f2d7c6afee45cd7db86fbe2508556f88518a3bdb (diff) |
Enforce consistency between shape_id and FL_EXIVAR
The FL_EXIVAR is a bit redundant with the shape_id.
Now that the `shape_id` is embedded in all objects on all archs,
we can cheaply check if an object has any fields with a simple
bitmask.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13612
Diffstat (limited to 'shape.c')
-rw-r--r-- | shape.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1266,6 +1266,13 @@ rb_shape_verify_consistency(VALUE obj, shape_id_t shape_id) } } + if (FL_TEST_RAW(obj, FL_EXIVAR)) { + RUBY_ASSERT(rb_obj_has_exivar(obj)); + } + else { + RUBY_ASSERT(!rb_obj_has_exivar(obj)); + } + return true; } #endif |