fix wrong count on IF/IFNOT jumps

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-14 16:48:20 +02:00
parent 16093adb09
commit abc574289f

4
ir.c
View file

@ -2342,13 +2342,13 @@ tailcall:
if (ontrue->generated) {
stmt.opcode = INSTR_IF;
stmt.o2.s1 = (ontrue->code_start-1) - code_statements_elements;
stmt.o2.s1 = (ontrue->code_start) - code_statements_elements;
if (code_statements_add(stmt) < 0)
return false;
}
if (onfalse->generated) {
stmt.opcode = INSTR_IFNOT;
stmt.o2.s1 = (onfalse->code_start-1) - code_statements_elements;
stmt.o2.s1 = (onfalse->code_start) - code_statements_elements;
if (code_statements_add(stmt) < 0)
return false;
}