Skip to content

Commit

Permalink
codegen: avoid unnecessary OP_MOVE after CASE
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Dec 3, 2016
1 parent 23c4ad0 commit c029c6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,9 @@ codegen(codegen_scope *s, node *tree, int val)
genop(s, MKOP_A(OP_LOADNIL, cursp()));
if (pos3) dispatch_linked(s, pos3);
if (head) pop();
genop(s, MKOP_AB(OP_MOVE, cursp(), pos));
if (cursp() != pos) {
genop(s, MKOP_AB(OP_MOVE, cursp(), pos));
}
push();
}
else {
Expand Down

0 comments on commit c029c6c

Please sign in to comment.