mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Make gen_assignment() to support NODE_SCALL; ref #3658
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user