]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
ir: don't require a label on a block
authorWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 24 Aug 2012 16:03:57 +0000 (18:03 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Fri, 24 Aug 2012 16:03:57 +0000 (18:03 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 0be4d05179916b09255a6570857a32591e84c344..0162e8e21845dee8931c7b40def150b628476559 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -462,7 +462,7 @@ ir_block* ir_block_new(ir_function* owner, const char *name)
     memset(self, 0, sizeof(*self));
 
     self->label = NULL;
-    if (!ir_block_set_label(self, name)) {
+    if (name && !ir_block_set_label(self, name)) {
         mem_d(self);
         return NULL;
     }
@@ -491,7 +491,7 @@ MEM_VEC_FUNCTIONS_ALL(ir_block, ir_value*, living)
 void ir_block_delete(ir_block* self)
 {
     size_t i;
-    mem_d(self->label);
+    if (self->label) mem_d(self->label);
     for (i = 0; i != self->instr_count; ++i)
         ir_instr_delete(self->instr[i]);
     MEM_VECTOR_CLEAR(self, instr);