aboutsummaryrefslogtreecommitdiffstats
path: root/prism_compile.c
diff options
context:
space:
mode:
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;
}
}
}