PR middle-end/54638
Backport from mainline
2012-04-19 Richard Guenther <rguenther@suse.de>
* ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound
array access.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191605
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-09-21 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/54638
+ Backport from mainline
+ 2012-04-19 Richard Guenther <rguenther@suse.de>
+
+ * ira-int.h (ira_allocno_object_iter_cond): Avoid out-of-bound
+ array access.
+
2012-09-20 Joseph Myers <joseph@codesourcery.com>
PR c/54552
ira_allocno_object_iter_cond (ira_allocno_object_iterator *i, ira_allocno_t a,
ira_object_t *o)
{
- *o = ALLOCNO_OBJECT (a, i->n);
- return i->n++ < ALLOCNO_NUM_OBJECTS (a);
+ int n = i->n++;
+ 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