From 2524d9c31b624535ac5085f2ae1871a5855912f0 Mon Sep 17 00:00:00 2001 From: "Wolfgang (Blub) Bumiller" Date: Fri, 24 Aug 2012 18:03:57 +0200 Subject: [PATCH] ir: don't require a label on a block --- ir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ir.c b/ir.c index 0be4d05..0162e8e 100644 --- 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); -- 2.39.2