]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
First generate the globals, then the fields, so the defs have the correct layout...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 12:15:49 +0000 (14:15 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 22 Aug 2012 12:15:49 +0000 (14:15 +0200)
ir.c

diff --git a/ir.c b/ir.c
index df2e32f06d47cb6e9f8aa635f4c9557f29a1e45f..74cb1cb7cf90c51eeb479133756c31c1b5541fb1 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2817,16 +2817,16 @@ bool ir_builder_generate(ir_builder *self, const char *filename)
 
     code_init();
 
-    for (i = 0; i < self->fields_count; ++i)
+    for (i = 0; i < self->globals_count; ++i)
     {
-        if (!ir_builder_gen_field(self, self->fields[i])) {
+        if (!ir_builder_gen_global(self, self->globals[i])) {
             return false;
         }
     }
 
-    for (i = 0; i < self->globals_count; ++i)
+    for (i = 0; i < self->fields_count; ++i)
     {
-        if (!ir_builder_gen_global(self, self->globals[i])) {
+        if (!ir_builder_gen_field(self, self->fields[i])) {
             return false;
         }
     }