aboutsummaryrefslogtreecommitdiffstats
path: root/prism_compile.c
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-11-29 14:58:26 -0500
committerJemma Issroff <jemmaissroff@gmail.com>2023-11-29 16:19:14 -0500
commit853fd44745241398d182d2af3ebdea10640ebf2e (patch)
tree803ec29c351b0b740fc995a2538a5119d988bd9f /prism_compile.c
parent2233204cc17521b960dad8b3758e6e0631a13672 (diff)
downloadruby-853fd44745241398d182d2af3ebdea10640ebf2e.tar.gz
[PRISM] Implement CallNodes with splat followed by args
Diffstat (limited to 'prism_compile.c')
-rw-r--r--prism_compile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/prism_compile.c b/prism_compile.c
index ca416547bb..79d5267667 100644
--- a/prism_compile.c
+++ b/prism_compile.c
@@ -1022,8 +1022,16 @@ pm_setup_args(pm_arguments_node_t *arguments_node, int *flags, struct rb_callinf
}
// If it's the final node
else if (index == arguments_node_list.size - 1) {
- ADD_INSN1(ret, &dummy_line_node, newarray, INT2FIX(post_splat_counter));
- ADD_INSN(ret, &dummy_line_node, concatarray);
+ if (post_splat_counter > 1) {
+ ADD_INSN1(ret, &dummy_line_node, newarray, INT2FIX(post_splat_counter));
+ ADD_INSN1(ret, &dummy_line_node, splatarray, Qfalse);
+ ADD_INSN(ret, &dummy_line_node, concatarray);
+ }
+ else {
+ ADD_INSN1(ret, &dummy_line_node, newarray, INT2FIX(post_splat_counter));
+ ADD_INSN(ret, &dummy_line_node, concatarray);
+ }
+ orig_argc = 1;
}
}
}