]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Don't die on functions with no variables
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Wed, 4 Jul 2012 11:16:15 +0000 (13:16 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Wed, 4 Jul 2012 11:16:15 +0000 (13:16 +0200)
ir.c

diff --git a/ir.c b/ir.c
index eeb55ce5a150c5801c708036ab76bddf4d6a4b0c..557a821886cd3df4488142c1ef6642e2b2427fa7 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1663,6 +1663,9 @@ bool ir_function_allocate_locals(ir_function *self)
 
     function_allocator alloc;
 
+    if (!self->locals_count)
+        return true;
+
     MEM_VECTOR_INIT(&alloc, locals);
     MEM_VECTOR_INIT(&alloc, sizes);
     MEM_VECTOR_INIT(&alloc, positions);