]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Ensure that the members[] array is filled for vector types so the liferange function...
authorWolfgang Bumiller <blub@speed.at>
Mon, 24 Dec 2012 11:52:15 +0000 (12:52 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 24 Dec 2012 11:52:15 +0000 (12:52 +0100)
ir.c

diff --git a/ir.c b/ir.c
index d57837017da16c47c0118f48f3a4ee5286a3d9f6..17bf16bd9e7eb867a2d4c6f01ee9ea3f85981f8b 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -3240,8 +3240,12 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
     case TYPE_FIELD:
         if (pushdef) {
             vec_push(code_defs, def);
-            if (global->fieldtype == TYPE_VECTOR)
+            if (global->fieldtype == TYPE_VECTOR) {
                 gen_vector_defs(def, global->name);
+                ir_value_vector_member(global, 0);
+                ir_value_vector_member(global, 1);
+                ir_value_vector_member(global, 2);
+            }
         }
         return gen_global_field(global);
     case TYPE_ENTITY:
@@ -3277,6 +3281,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
     case TYPE_VECTOR:
     {
         size_t d;
+        ir_value_vector_member(global, 0);
+        ir_value_vector_member(global, 1);
+        ir_value_vector_member(global, 2);
         ir_value_code_setaddr(global, vec_size(code_globals));
         if (global->hasvalue) {
             iptr = (int32_t*)&global->constval.ivec[0];