aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorMartin Liska <marxin.liska@gmail.com>2013-08-21 14:27:10 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-21 14:27:10 +0000
commite0df53dd42f2ce39a6eebc879e535698eca88aff (patch)
tree854f1e33be25b57456abb59d3d1de94dbb40fbae /gcc/ipa.c
parente7d1d3ebe7bd4ab37bd243a65889bb7553bfc4e2 (diff)
downloadgcc-e0df53dd42f2ce39a6eebc879e535698eca88aff.zip
gcc-e0df53dd42f2ce39a6eebc879e535698eca88aff.tar.gz
gcc-e0df53dd42f2ce39a6eebc879e535698eca88aff.tar.bz2
* ipa.c (ipa_profile_read_summary): Fix buffer overflow.
From-SVN: r201900
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 1578aed..7e8a82c 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--)
{