]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Fix a type size bug: non-var locals overlapped with var locals, that was bad
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 1 Dec 2012 22:23:00 +0000 (23:23 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 1 Dec 2012 22:23:00 +0000 (23:23 +0100)
ir.c

diff --git a/ir.c b/ir.c
index f1ffc7fa4fbaa5e0ca265fd0ce8ed43953620c0b..dbb1d97a46ae58e8d881a3ec40a351aaa395ba49 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2849,7 +2849,10 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
     if (vec_size(irfun->locals)) {
         ir_value *last = vec_last(irfun->locals);
         local_var_end = last->code.globaladdr;
-        local_var_end += type_sizeof[last->vtype];
+        if (last->vtype == TYPE_FIELD && last->fieldtype == TYPE_VECTOR)
+            local_var_end += type_sizeof[TYPE_VECTOR];
+        else
+            local_var_end += type_sizeof[last->vtype];
     }
     for (i = 0; i < vec_size(irfun->values); ++i)
     {