codegen: avoid unnecessary OP_MOVE after CASE

parent 23c4ad08
...@@ -1520,7 +1520,9 @@ codegen(codegen_scope *s, node *tree, int val) ...@@ -1520,7 +1520,9 @@ codegen(codegen_scope *s, node *tree, int val)
genop(s, MKOP_A(OP_LOADNIL, cursp())); genop(s, MKOP_A(OP_LOADNIL, cursp()));
if (pos3) dispatch_linked(s, pos3); if (pos3) dispatch_linked(s, pos3);
if (head) pop(); if (head) pop();
genop(s, MKOP_AB(OP_MOVE, cursp(), pos)); if (cursp() != pos) {
genop(s, MKOP_AB(OP_MOVE, cursp(), pos));
}
push(); push();
} }
else { else {
......
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