From d9cca87aff2b4f0def2c852e92edde49cf58999f Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Tue, 18 Dec 2012 12:57:09 +0100 Subject: [PATCH] Don't generate IF/IFNOT with +1 offsets --- ir.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.39.2