From 2f8cbd6431016cf3498b0f26e56d3d5b214b58b0 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Wed, 13 Mar 2024 15:38:44 -0400 Subject: [PATCH] [PRISM] Handle ambiguous_param0 for it and numbered parameters --- prism_compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/prism_compile.c b/prism_compile.c index 1fef124455..d28eeb662a 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -7008,11 +7008,14 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, break; } case PM_NUMBERED_PARAMETERS_NODE: { - body->param.lead_num = ((pm_numbered_parameters_node_t *) scope_node->parameters)->maximum; + uint32_t maximum = ((pm_numbered_parameters_node_t *) scope_node->parameters)->maximum; + body->param.lead_num = maximum; + body->param.flags.ambiguous_param0 = maximum == 1; break; } case PM_IT_PARAMETERS_NODE: body->param.lead_num = 1; + body->param.flags.ambiguous_param0 = true; break; default: rb_bug("Unexpected node type for parameters: %s", pm_node_type_to_str(PM_NODE_TYPE(node)));