From 3016f30c956413268655dcb25dbe5041684f9528 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 18 Apr 2023 14:45:18 -0700 Subject: Return NULL to indicate the next shape isn't found During compaction we must fix up shapes on objects who were extended but then became embedded. `rb_shape_traverse_from_new_root` is supposed to walk shape trees looking for a matching shape. When a shape has a "single child" we weren't returning NULL when the edge names didn't match. In the case of a single outgoing edge, this patch returns NULL when the child edge name doesn't match (similar to the case when a shape has a hash of outgoing edges) --- shape.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shape.c') diff --git a/shape.c b/shape.c index 5694833bfa..0651ec3172 100644 --- a/shape.c +++ b/shape.c @@ -497,6 +497,9 @@ rb_shape_traverse_from_new_root(rb_shape_t *initial_shape, rb_shape_t *dest_shap if (child->edge_name == dest_shape->edge_name) { return child; } + else { + return NULL; + } } else { if (rb_id_table_lookup(next_shape->edges, dest_shape->edge_name, &lookup_result)) { -- cgit v1.2.1