diff options
author | Jemma Issroff <jemmaissroff@gmail.com> | 2023-01-25 13:45:32 -0500 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2023-01-25 14:48:28 -0500 |
commit | 78fcc9847a9db6d42c8c263154ec05903a370b6b (patch) | |
tree | e310032c5be7cf4ab698bf8cb530c5f69f3b9bac /shape.c | |
parent | 5e1e5af2e737bdc5537b4d2025d2ae8e57df3cdb (diff) |
Limit maximum number of IVs on a shape
Create SHAPE_MAX_NUM_IVS (currently 50) and limit all shapes to that
number of IVs. When a shape has more than 50 IVs, fallback to the
obj_too_complex shape which uses hash lookup for ivs.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7183
Diffstat (limited to 'shape.c')
-rw-r--r-- | shape.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -139,7 +139,7 @@ get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type, b *variation_created = false; - if (new_shapes_allowed) { + if (new_shapes_allowed && shape->next_iv_index < SHAPE_MAX_NUM_IVS) { RB_VM_LOCK_ENTER(); { bool had_edges = !!shape->edges; |