summaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-21 14:27:10 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2013-08-21 14:27:10 +0000
commit90d0add26322ab9d8cbedb8cd95f7e022a17f8a9 (patch)
tree854f1e33be25b57456abb59d3d1de94dbb40fbae /gcc/ipa.c
parent04674afb49ffdfc299fb2cf49c61f44d3eb1edbb (diff)
downloadgcc-90d0add26322ab9d8cbedb8cd95f7e022a17f8a9.tar.gz
* ipa.c (ipa_profile_read_summary): Fix buffer overflow.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201900 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 1578aed70e8..7e8a82cc432 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -1397,7 +1397,7 @@ ipa_profile_read_summary (void)
static unsigned int
ipa_profile (void)
{
- struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
+ struct cgraph_node **order;
struct cgraph_edge *e;
int order_pos;
bool something_changed = false;
@@ -1575,6 +1575,7 @@ ipa_profile (void)
nuseless, nuseless * 100.0 / nindirect,
nconverted, nconverted * 100.0 / nindirect);
+ order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
order_pos = ipa_reverse_postorder (order);
for (i = order_pos - 1; i >= 0; i--)
{