Commit 96bef462 authored by Michael Beck's avatar Michael Beck
Browse files

Undo wrong r27240 and fix an off-by-one bug when a phase is enlarged.

[r27244]
parent c4821986
......@@ -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 = old_cap + (size_t) (max_idx * phase->growth_factor / 256);
new_cap = (size_t) (max_idx * phase->growth_factor / 256);
phase->data_ptr = XREALLOC(phase->data_ptr, void*, new_cap);
......@@ -323,7 +323,7 @@ static inline void *_phase_set_irn_data(ir_phase *ph, const ir_node *irn, void *
void *res;
/* Assure that there's a sufficient amount of slots. */
_private_phase_assure_capacity(ph, idx);
_private_phase_assure_capacity(ph, idx + 1);
res = ph->data_ptr[idx];
ph->data_ptr[idx] = data;
......@@ -338,7 +338,7 @@ static inline void *_phase_get_or_set_irn_data(ir_phase *ph, const ir_node *irn)
void *res;
/* Assure that there's a sufficient amount of slots. */
_private_phase_assure_capacity(ph, idx);
_private_phase_assure_capacity(ph, idx + 1);
res = ph->data_ptr[idx];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment