Fix RubyVM::Shape.transition_tree

This commit is contained in:
Étienne Barrié 2025-06-10 17:04:07 +02:00 committed by Jean Boussier
parent bcb4fbe2eb
commit c54e96d651
Notes: git 2025-06-10 17:37:16 +00:00

View File

@ -1391,6 +1391,7 @@ static enum rb_id_table_iterator_result collect_keys_and_values(ID key, VALUE va
static VALUE edges(VALUE edges) static VALUE edges(VALUE edges)
{ {
VALUE hash = rb_hash_new(); VALUE hash = rb_hash_new();
if (edges) {
if (SINGLE_CHILD_P(edges)) { if (SINGLE_CHILD_P(edges)) {
rb_shape_t *child = SINGLE_CHILD(edges); rb_shape_t *child = SINGLE_CHILD(edges);
collect_keys_and_values(child->edge_name, (VALUE)child, &hash); collect_keys_and_values(child->edge_name, (VALUE)child, &hash);
@ -1398,6 +1399,7 @@ static VALUE edges(VALUE edges)
else { else {
rb_managed_id_table_foreach(edges, collect_keys_and_values, &hash); rb_managed_id_table_foreach(edges, collect_keys_and_values, &hash);
} }
}
return hash; return hash;
} }