From 1a9e2d20e2c66933f8eb891a1ee85fae6015fcf1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 17 Mar 2023 11:39:35 -0700 Subject: Fix shape allocation limits We can only allocate enough shapes to fit in the shape buffer. MAX_SHAPE_ID was based on the theoretical maximum number of shapes we could have, not on the amount of memory we can actually consume. This commit changes the MAX_SHAPE_ID to be based on the amount of memory we're allowed to consume. Co-Authored-By: Jemma Issroff --- shape.c | 1 + 1 file changed, 1 insertion(+) (limited to 'shape.c') diff --git a/shape.c b/shape.c index e264e7bee5..cf1a4426eb 100644 --- a/shape.c +++ b/shape.c @@ -145,6 +145,7 @@ get_next_shape_internal(rb_shape_t * shape, ID id, enum shape_type shape_type, b new_shape->type = (uint8_t)shape_type; new_shape->capacity = shape->capacity; + new_shape->edges = NULL; switch (shape_type) { case SHAPE_IVAR: -- cgit v1.2.1