From 6235ec59a1b864e064dd9cb54a63f529769cbc19 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Thu, 23 Dec 2004 15:05:50 +0000 Subject: [PATCH] used xmalloc instead of malloc [r4745] --- ir/ir/irreflect.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ir/ir/irreflect.c b/ir/ir/irreflect.c index b88aa3c6b..8bf4c3807 100644 --- a/ir/ir/irreflect.c +++ b/ir/ir/irreflect.c @@ -20,9 +20,7 @@ # include #endif -#define obstack_chunk_alloc malloc -#define obstack_chunk_free free -#include +#include "obst.h" #include "irmode.h" #include "irreflect.h" @@ -81,7 +79,7 @@ static INLINE void assure_opcode_capacity(int opcode) { if(opcode >= opcodes_size) { int new_size = 2 * opcode; - rflct_opcode_t **new_opcodes = malloc(sizeof(*new_opcodes) * new_size); + rflct_opcode_t **new_opcodes = xmalloc(sizeof(new_opcodes[0]) * new_size); memset(new_opcodes, 0, sizeof(*new_opcodes) * new_size); @@ -437,7 +435,7 @@ bool rflct_opcode_add_signature(opcode opc, rflct_sig_t *sig) rflct_sig_t *rflct_signature_allocate(int defs, int uses) { - rflct_sig_t *sig = malloc(sizeof(*sig)); + rflct_sig_t *sig = xmalloc(sizeof(*sig)); rflct_arg_t *args = obstack_alloc(&obst, sizeof(*args) * (defs + uses + 2)); -- 2.20.1