Skip to content

Commit

Permalink
fixed remaining bugs in OP_ASGN stack adjustment; close #3159
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 16, 2016
1 parent 29d3a40 commit 6b0299f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1855,15 +1855,16 @@ codegen(codegen_scope *s, node *tree, int val)
gen_assignment(s, tree->car, cursp(), val);
}
else {
if (val) {
genop(s, MKOP_AB(OP_MOVE, vsp, cursp()));
}
if (callargs == CALL_MAXARGS) {
genop(s, MKOP_AB(OP_ARYPUSH, cursp()-1, cursp()));
if (val) {
genop(s, MKOP_AB(OP_MOVE, vsp, cursp()));
}
pop();
genop(s, MKOP_AB(OP_ARYPUSH, cursp(), cursp()+1));
}
else if (val) {
genop(s, MKOP_AB(OP_MOVE, vsp, cursp()));
else {
pop_n(callargs);
callargs++;
}
pop();
idx = new_msym(s, attrsym(s,sym(tree->car->cdr->cdr->car)));
Expand Down

0 comments on commit 6b0299f

Please sign in to comment.