Skip to content
Permalink
Browse files
Make gen_assignment() to support NODE_SCALL; ref #3658
  • Loading branch information
matz committed May 25, 2017
1 parent 4566c80 commit 5e1a6a2cc296dfbe9e311870d24dfcbc0aee1fad
Showing 1 changed file with 4 additions and 2 deletions.
@@ -956,7 +956,7 @@ gen_assignment(codegen_scope *s, node *tree, int sp, int val)
int type = (intptr_t)tree->car;

tree = tree->cdr;
switch ((intptr_t)type) {
switch (type) {
case NODE_GVAR:
idx = new_sym(s, sym(tree));
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)
break;

case NODE_CALL:
case NODE_SCALL:
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();
if (val) {
genop_peep(s, MKOP_AB(OP_MOVE, cursp(), sp), val);

0 comments on commit 5e1a6a2

Please sign in to comment.