fixed a bug when number of LHS and RHS differs; fix #3239

parent 872517df
...@@ -1655,11 +1655,21 @@ codegen(codegen_scope *s, node *tree, int val) ...@@ -1655,11 +1655,21 @@ codegen(codegen_scope *s, node *tree, int val)
} }
tree = tree->car; tree = tree->car;
if (tree->car) { /* pre */ if (tree->car) { /* pre */
int first = TRUE;
t = tree->car; t = tree->car;
n = 0; n = 0;
while (t) { while (t) {
if (n < len) {
gen_assignment(s, t->car, rhs+n, NOVAL); gen_assignment(s, t->car, rhs+n, NOVAL);
n++; n++;
}
else {
if (first) {
genop(s, MKOP_A(OP_LOADNIL, rhs+n));
first = FALSE;
}
gen_assignment(s, t->car, rhs+n, NOVAL);
}
t = t->cdr; t = t->cdr;
} }
} }
......
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