]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.c
vector components are floats, not vectors
[xonotic/gmqcc.git] / ir.c
diff --git a/ir.c b/ir.c
index a2b6dcc140edf6acd11d5894f182253f606d969e..458d2cfe4723119f3bef90e9466df41f88835658 100644 (file)
--- 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;
@@ -3155,6 +3158,8 @@ static void gen_vector_defs(prog_section_def def, const char *name)
     if (!name || OPTS_FLAG(SINGLE_VECTOR_DEFS))
         return;
 
+    def.type = TYPE_FLOAT;
+
     len = strlen(name);
 
     component = (char*)mem_a(len+3);
@@ -3181,6 +3186,8 @@ static void gen_vector_fields(prog_section_field fld, const char *name)
     if (!name || OPTS_FLAG(SINGLE_VECTOR_DEFS))
         return;
 
+    def.type = TYPE_FLOAT;
+
     len = strlen(name);
 
     component = (char*)mem_a(len+3);