From 8c82c6f54cb32864dd266bc1066a50db7bc8c073 Mon Sep 17 00:00:00 2001 From: Jonas Fietz Date: Sat, 27 Feb 2010 01:32:36 +0000 Subject: [PATCH] fix an offset bug in allocating memory for irg phases [r27240] --- ir/ir/irphase_t.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir/ir/irphase_t.h b/ir/ir/irphase_t.h index 9bffdaba8..232af1eaa 100644 --- a/ir/ir/irphase_t.h +++ b/ir/ir/irphase_t.h @@ -297,7 +297,7 @@ static inline void _private_phase_enlarge(ir_phase *phase, unsigned max_idx) /* make the maximum index at least as big as the largest index in the graph. */ max_idx = MAX(max_idx, last_irg_idx); - new_cap = (size_t) (max_idx * phase->growth_factor / 256); + new_cap = old_cap + (size_t) (max_idx * phase->growth_factor / 256); phase->data_ptr = XREALLOC(phase->data_ptr, void*, new_cap); -- 2.20.1