From: Wolfgang Bumiller <wry.git@bumiller.com>
Date: Mon, 26 Aug 2013 08:23:20 +0000 (+0200)
Subject: error when trying to pass a TYPE_NOEXPR value to ir_instr_op
X-Git-Tag: 0.3.5~148
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=59586877950c8b7138063fa22fc4740864986fa3;p=xonotic%2Fgmqcc.git

error when trying to pass a TYPE_NOEXPR value to ir_instr_op
---

diff --git a/ir.c b/ir.c
index ec45a8f..f48d83b 100644
--- a/ir.c
+++ b/ir.c
@@ -1032,6 +1032,11 @@ static void ir_instr_delete(ir_instr *self)
 
 static bool ir_instr_op(ir_instr *self, int op, ir_value *v, bool writing)
 {
+    if (v && v->vtype == TYPE_NOEXPR) {
+        irerror(self->context, "tried to use a NOEXPR value");
+        return false;
+    }
+
     if (self->_ops[op]) {
         size_t idx;
         if (writing && vec_ir_instr_find(self->_ops[op]->writes, self, &idx))