10000 Fix RubyVM::Shape.transition_tree · ruby/ruby@c1589f2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c1589f2

Browse files
committed
Fix RubyVM::Shape.transition_tree
1 parent 585dcff commit c1589f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

shape.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,12 +1391,14 @@ static enum rb_id_table_iterator_result collect_keys_and_values(ID key, VALUE va
13911391
static VALUE edges(VALUE edges)
13921392
{
13931393
VALUE hash = rb_hash_new();
1394-
if (SINGLE_CHILD_P(edges)) {
1395-
rb_shape_t *child = SINGLE_CHILD(edges);
1396-
collect_keys_and_values(child->edge_name, (VALUE)child, &hash);
1397-
}
1398-
else {
1399-
rb_managed_id_table_foreach(edges, collect_keys_and_values, &hash);
1394+
if (edges) {
1395+
if (SINGLE_CHILD_P(edges)) {
1396+
rb_shape_t *child = SINGLE_CHILD(edges);
1397+
collect_keys_and_values(child->edge_name, (VALUE)child, &hash);
1398+
}
1399+
else {
1400+
rb_managed_id_table_foreach(edges, collect_keys_and_values, &hash);
1401+
}
14001402
}
14011403
return hash;
14021404
}

0 commit comments

Comments
 (0)
0