]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
use type_sizeof in another place where it wasn't
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sun, 22 Jul 2012 10:20:06 +0000 (12:20 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sun, 22 Jul 2012 10:20:06 +0000 (12:20 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 0c0517a54d791cfdd248efcd98d8b4433fa8e9f4..2a5018b0cb94c6441047bac8d256f2f06e8d3756 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2371,6 +2371,7 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
 
 static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
 {
+    size_t           i;
     int32_t         *iptr;
     prog_section_def def;
 
@@ -2450,8 +2451,8 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
     case TYPE_VARIANT:
         /* assume biggest type */
             global->code.globaladdr = code_globals_add(0);
-            code_globals_add(0);
-            code_globals_add(0);
+            for (i = 1; i < type_sizeof[TYPE_VARIANT]; ++i)
+                code_globals_add(0);
             return true;
     default:
         /* refuse to create 'void' type or any other fancy business. */