Actually allocate a nil-vector for nil
authorWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 12:25:18 +0000 (13:25 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 12:25:18 +0000 (13:25 +0100)
ir.c

diff --git a/ir.c b/ir.c
index d3d61f54abc8a9487766d570e24ff838e9083628..9f76892f67af0cd3be1c0015c3e4957127a1dd86 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -3643,6 +3643,12 @@ bool ir_builder_generate(ir_builder *self, const char *filename)
         }
     }
 
+    /* generate nil */
+    ir_value_code_setaddr(self->nil, vec_size(code_globals));
+    vec_push(code_globals, 0);
+    vec_push(code_globals, 0);
+    vec_push(code_globals, 0);
+
     /* generate global temps */
     self->first_common_globaltemp = vec_size(code_globals);
     for (i = 0; i < self->max_globaltemps; ++i) {