fix an offset bug in allocating memory for irg phases
authorJonas Fietz <fietz@ipd.info.uni-karlsruhe.de>
Sat, 27 Feb 2010 01:32:36 +0000 (01:32 +0000)
committerJonas Fietz <fietz@ipd.info.uni-karlsruhe.de>
Sat, 27 Feb 2010 01:32:36 +0000 (01:32 +0000)
[r27240]

ir/ir/irphase_t.h

index 9bffdab..232af1e 100644 (file)
@@ -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);