]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix a possibly uninitialized variable
authorWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 28 Jun 2012 15:27:02 +0000 (17:27 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Thu, 28 Jun 2012 15:27:02 +0000 (17:27 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 74363f8df0188565c3704934837b3e93749e1e48..e05f4d70615034352a6ee76a2364e56c23f5457f 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1665,6 +1665,10 @@ bool ir_function_allocate_locals(ir_function *self)
     if (!function_allocator_positions_add(&alloc, 0))
         goto error;
 
+    if (alloc.sizes_count)
+        pos = alloc.positions[0] + alloc.sizes[0];
+    else
+        pos = 0;
     for (i = 1; i < alloc.sizes_count; ++i)
     {
         pos = alloc.positions[i-1] + alloc.sizes[i-1];