Commit d0a854af by Richard Guenther Committed by Richard Biener

ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound array access.

2012-04-19  Richard Guenther  <rguenther@suse.de>

	* ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound
	array access.

From-SVN: r186590
parent 20955f5a
2012-04-19 Richard Guenther <rguenther@suse.de>
* ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound
array access.
2012-04-19 Georg-Johann Lay <avr@gjlay.de> 2012-04-19 Georg-Johann Lay <avr@gjlay.de>
PR target/53033 PR target/53033
......
...@@ -1138,8 +1138,13 @@ static inline bool ...@@ -1138,8 +1138,13 @@ static inline bool
ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a, ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
ira_object_t *o) ira_object_t *o)
{ {
*o = ALLOCNO_OBJECT (a, i->n); int n = i->n++;
return i->n++ < ALLOCNO_NUM_OBJECTS (a); if (n < ALLOCNO_NUM_OBJECTS (a))
{
*o = ALLOCNO_OBJECT (a, n);
return true;
}
return false;
} }
/* Loop over all objects associated with allocno A. In each /* Loop over all objects associated with allocno A. In each
......
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