]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Check for TYPE_FIELD in load_from_ent
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Tue, 1 May 2012 10:14:07 +0000 (12:14 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Tue, 1 May 2012 10:14:07 +0000 (12:14 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 2d5977a9d5a5fbbe7851273e049936a0086ffbf7..720efc9b97bc20d4620a31290da0f5d350b9935c 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -964,6 +964,10 @@ ir_value* ir_block_create_load_from_ent(ir_block *self, const char *label, ir_va
     if (ent->vtype != TYPE_ENTITY)
         return NULL;
 
+    /* at some point we could redirect for TYPE_POINTER... but that could lead to carelessness */
+    if (field->vtype != TYPE_FIELD)
+        return NULL;
+
     switch (outype)
     {
         case TYPE_FLOAT:   op = INSTR_LOAD_F;   break;