Make `gen_assignment()` to support `NODE_SCALL`; ref #3658

parent 4566c80d
...@@ -956,7 +956,7 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val) ...@@ -956,7 +956,7 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
int type = (intptr_t)tree->car; int type = (intptr_t)tree->car;
tree = tree->cdr; tree = tree->cdr;
switch ((intptr_t)type) { switch (type) {
case NODE_GVAR: case NODE_GVAR:
idx = new_sym(s, sym(tree)); idx = new_sym(s, sym(tree));
genop_peep(s, MKOP_ABx(OP_SETGLOBAL, sp, idx), val); genop_peep(s, MKOP_ABx(OP_SETGLOBAL, sp, idx), val);
...@@ -1006,8 +1006,10 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val) ...@@ -1006,8 +1006,10 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
break; break;
case NODE_CALL: case NODE_CALL:
case NODE_SCALL:
push(); push();
gen_call(s, tree, attrsym(s, sym(tree->cdr->car)), sp, NOVAL, 0); gen_call(s, tree, attrsym(s, sym(tree->cdr->car)), sp, NOVAL,
type == NODE_SCALL);
pop(); pop();
if (val) { if (val) {
genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val); genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val);
......
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