From: Wolfgang (Blub) Bumiller Date: Tue, 18 Dec 2012 11:57:09 +0000 (+0100) Subject: Don't generate IF/IFNOT with +1 offsets X-Git-Tag: 0.1.9~62 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d9cca87aff2b4f0def2c852e92edde49cf58999f;p=xonotic%2Fgmqcc.git Don't generate IF/IFNOT with +1 offsets --- diff --git a/ir.c b/ir.c index a2b6dcc..f5ad97e 100644 --- a/ir.c +++ b/ir.c @@ -2712,12 +2712,14 @@ tailcall: if (ontrue->generated) { stmt.opcode = INSTR_IF; stmt.o2.s1 = (ontrue->code_start) - vec_size(code_statements); - code_push_statement(&stmt, instr->context.line); + 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); - code_push_statement(&stmt, instr->context.line); + if (stmt.o2.s1 != 1) + code_push_statement(&stmt, instr->context.line); } if (!ontrue->generated) { if (onfalse->generated) { @@ -2741,7 +2743,8 @@ tailcall: ontrue = tmp; } stidx = vec_size(code_statements); - code_push_statement(&stmt, instr->context.line); + 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)) return false;