]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ir.cpp
ir: fix vector negation using the nil value
[xonotic/gmqcc.git] / ir.cpp
diff --git a/ir.cpp b/ir.cpp
index 5df12449362846ac36e9ca3e19a608c257c185b6..7a2583bea832c99090d676b57126735cad9a88b4 100644 (file)
--- a/ir.cpp
+++ b/ir.cpp
@@ -1643,7 +1643,7 @@ ir_value* ir_block_create_unary(ir_block *self, lex_ctx_t ctx,
         case VINSTR_NEG_F:
             return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_F, nullptr, operand, ot);
         case VINSTR_NEG_V:
-            return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, nullptr, operand, TYPE_VECTOR);
+            return ir_block_create_general_instr(self, ctx, label, INSTR_SUB_V, self->m_owner->m_owner->m_nil, operand, TYPE_VECTOR);
 
         default:
             ot = operand->m_vtype;