]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Don't generate 'jump +1' instructions
authorWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 10:57:30 +0000 (11:57 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Tue, 18 Dec 2012 10:57:30 +0000 (11:57 +0100)
ir.c

diff --git a/ir.c b/ir.c
index 9f6abb2ef18cc5303ec111386a022f00708163c3..73f574e6c37618b5309b51644bd72765d420ed18 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2691,7 +2691,8 @@ tailcall:
             stmt.o1.s1 = (target->code_start) - vec_size(code_statements);
             stmt.o2.s1 = 0;
             stmt.o3.s1 = 0;
-            code_push_statement(&stmt, instr->context.line);
+            if (stmt.o1.s1 != 1)
+                code_push_statement(&stmt, instr->context.line);
 
             /* no further instructions can be in this block */
             return true;
@@ -2765,7 +2766,8 @@ tailcall:
                 stmt.o1.s1 = (onfalse->code_start) - vec_size(code_statements);
                 stmt.o2.s1 = 0;
                 stmt.o3.s1 = 0;
-                code_push_statement(&stmt, instr->context.line);
+                if (stmt.o1.s1 != 1)
+                    code_push_statement(&stmt, instr->context.line);
                 return true;
             }
             /* if not, generate now */