Commit 1ba6995a authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1521 from Fleurer/issue-1519

fix #1519
parents e870ed70 af5bec1f
......@@ -684,16 +684,23 @@ static int
gen_values(codegen_scope *s, node *t, int val)
{
int n = 0;
int is_splat;
while (t) {
if (n >= 127 || (intptr_t)t->car->car == NODE_SPLAT) { // splat mode
is_splat = (intptr_t)t->car->car == NODE_SPLAT; // splat mode
if (n >= 127 || is_splat) {
if (val) {
pop_n(n);
genop(s, MKOP_ABC(OP_ARRAY, cursp(), cursp(), n));
push();
codegen(s, t->car, VAL);
pop(); pop();
genop(s, MKOP_AB(OP_ARYCAT, cursp(), cursp()+1));
if (is_splat) {
genop(s, MKOP_AB(OP_ARYCAT, cursp(), cursp()+1));
}
else {
genop(s, MKOP_AB(OP_ARYPUSH, cursp(), cursp()+1));
}
t = t->cdr;
while (t) {
push();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment