jump address error when value taken from if statement without else clause; close #712

parent eab894e5
......@@ -1114,12 +1114,18 @@ codegen(codegen_scope *s, node *tree, int val)
else {
if (val) {
pop();
pos2 = new_label(s);
genop(s, MKOP_sBx(OP_JMP, 0));
dispatch(s, pos1);
genop(s, MKOP_A(OP_LOADNIL, cursp()));
dispatch(s, pos2);
push();
}
else {
dispatch(s, pos1);
}
}
}
break;
case NODE_AND:
......
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