diff options
author | Nick Clifton <nickc@redhat.com> | 2011-10-25 08:38:49 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-10-25 08:38:49 +0000 |
commit | ee41185153305a4f4af0fc5d77fc64fc1f75211c (patch) | |
tree | e43132802ef3d35c82eaaa222d3660c9942e7022 /gprof | |
parent | e6d3929942c1373d9c68f62ca2cc91362c5916cc (diff) | |
download | binutils-redhat-ee41185153305a4f4af0fc5d77fc64fc1f75211c.tar.gz |
PR gprof/13325
* hist.c (hist_assign_samples_1): Make sure that inner loop
iterator remains valid.
Diffstat (limited to 'gprof')
-rw-r--r-- | gprof/ChangeLog | 6 | ||||
-rw-r--r-- | gprof/hist.c | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog index fd989950aa..20464e8da1 100644 --- a/gprof/ChangeLog +++ b/gprof/ChangeLog @@ -1,3 +1,9 @@ +2011-10-25 Wei Guozhi <carrot@google.com> + + PR gprof/13325 + * hist.c (hist_assign_samples_1): Make sure that inner loop + iterator remains valid. + 2011-10-24 Nick Clifton <nickc@redhat.com> * po/ja.po: New Japanese translation. diff --git a/gprof/hist.c b/gprof/hist.c index 25364b215e..572bacfb22 100644 --- a/gprof/hist.c +++ b/gprof/hist.c @@ -398,7 +398,12 @@ hist_assign_samples_1 (histogram *r) /* If high end of bin is below entry address, go for next bin. */ if (bin_high_pc < sym_low_pc) - break; + { + /* PR gprof/13325: Make sure that j does not go below 1. */ + if (j < 1) + j = 1; + break; + } /* If low end of bin is above high end of symbol, go for next symbol. */ |