Don't generate IF/IFNOT with +1 offsets

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-12-18 12:57:09 +01:00
parent d09ab90f24
commit d9cca87aff

3
ir.c
View file

@ -2712,11 +2712,13 @@ tailcall:
if (ontrue->generated) {
stmt.opcode = INSTR_IF;
stmt.o2.s1 = (ontrue->code_start) - vec_size(code_statements);
if (stmt.o2.s1 != 1)
code_push_statement(&stmt, instr->context.line);
}
if (onfalse->generated) {
stmt.opcode = INSTR_IFNOT;
stmt.o2.s1 = (onfalse->code_start) - vec_size(code_statements);
if (stmt.o2.s1 != 1)
code_push_statement(&stmt, instr->context.line);
}
if (!ontrue->generated) {
@ -2741,6 +2743,7 @@ tailcall:
ontrue = tmp;
}
stidx = vec_size(code_statements);
if (stmt.o2.s1 != 1)
code_push_statement(&stmt, instr->context.line);
/* on false we jump, so add ontrue-path */
if (!gen_blocks_recursive(func, ontrue))