]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
error when trying to pass a TYPE_NOEXPR value to ir_instr_op
authorWolfgang Bumiller <wry.git@bumiller.com>
Mon, 26 Aug 2013 08:23:20 +0000 (10:23 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Mon, 26 Aug 2013 08:23:20 +0000 (10:23 +0200)
ir.c

diff --git a/ir.c b/ir.c
index ec45a8f67cf78081e3db109e2f0e3d8fe0b82994..f48d83bc50631e90b605a220de109c706e53236f 100644 (file)
--- 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)
 {
 
 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))
     if (self->_ops[op]) {
         size_t idx;
         if (writing && vec_ir_instr_find(self->_ops[op]->writes, self, &idx))