codegen.c: should not skip rhs array; fix #5797

When the value of multiple assignment taken, the rhs array needs to be
generated anyway.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-10-01 15:18:45 +09:00
parent db7d40be85
commit 751ac378bd
+1 -5
View File
@@ -2753,7 +2753,7 @@ codegen(codegen_scope *s, node *tree, int val)
node *t = tree->cdr, *p;
int rhs = cursp();
if (nint(t->car) == NODE_ARRAY && t->cdr && nosplat(t->cdr)) {
if (!val && nint(t->car) == NODE_ARRAY && t->cdr && nosplat(t->cdr)) {
/* fixed rhs */
t = t->cdr;
while (t) {
@@ -2820,10 +2820,6 @@ codegen(codegen_scope *s, node *tree, int val)
}
}
pop_n(len);
if (val) {
genop_2(s, OP_ARRAY, rhs, len);
push();
}
}
else {
/* variable rhs */