]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ir: fix bug that functions without declared locals would put temps at position zero ...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 14:49:24 +0000 (16:49 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 14:49:24 +0000 (16:49 +0200)
ir.c

diff --git a/ir.c b/ir.c
index dcf03e0f2905397a839542194e2b1c58b820fc20..ed01439943131636e368a48cee3b4d45f5d39e65 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -2548,7 +2548,7 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
     fun.firstlocal = code_globals_elements;
     fun.locals     = irfun->allocated_locals + irfun->locals_count;
 
-    local_var_end = 0;
+    local_var_end = fun.firstlocal;
     for (i = 0; i < irfun->locals_count; ++i) {
         if (!ir_builder_gen_global(ir, irfun->locals[i])) {
             irerror(irfun->locals[i]->context, "Failed to generate global %s\n", irfun->locals[i]->name);