]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
ir: fix vector negation using the nil value
authorWolfgang Bumiller <wry.git@bumiller.com>
Thu, 22 Jun 2017 06:44:35 +0000 (08:44 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Thu, 22 Jun 2017 06:44:36 +0000 (08:44 +0200)
We cannot use OFS_NULL as it is only a single value and
overlaps with OFS_RETURN.

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;