summaryrefslogtreecommitdiff
path: root/prism_compile.c
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-08-28 16:22:00 -0400
committerAlan Wu <[email protected]>2024-08-28 17:17:33 -0400
commitc3ffa7106b8cd89bdc85f579a8e27cde6b5539ab ()
tree617b1d5c149c4d437d09e05b3f4278aeda8a5d82 /prism_compile.c
parentdba9601e0f9c42698cb6ca804d604bcdacbd60b7 (diff)
[PRISM] Set use_block parameter flag for forwardable methods
Match logic in compile.c:2133. Without this, the unused block warning code allocates an array, causing TestAllocation to fail.
Notes: Merged: https://.com/ruby/ruby/pull/11484
-rw-r--r--prism_compile.c1
1 files changed, 1 insertions, 0 deletions
@@ -8671,6 +8671,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
if (PM_NODE_TYPE_P(parameters_node->keyword_rest, PM_FORWARDING_PARAMETER_NODE)) {
// Only optimize specifically methods like this: `foo(...)`
if (requireds_list->size == 0 && optionals_list->size == 0 && keywords_list->size == 0) {
ISEQ_BODY(iseq)->param.flags.forwardable = TRUE;
table_size += 1;
}