aboutsummaryrefslogtreecommitdiff
path: root/gprof/hist.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-10-25 08:38:49 +0000
committerNick Clifton <nickc@redhat.com>2011-10-25 08:38:49 +0000
commit0a394bfbada7defad3dff1fdcaa86e0e5a13c656 (patch)
tree26187a10de726781f0b8fe295562e7f0e4f3d245 /gprof/hist.c
parent81472056d738c3b07914f3dad5edb0f4af45a050 (diff)
downloadgdb-0a394bfbada7defad3dff1fdcaa86e0e5a13c656.zip
gdb-0a394bfbada7defad3dff1fdcaa86e0e5a13c656.tar.gz
gdb-0a394bfbada7defad3dff1fdcaa86e0e5a13c656.tar.bz2
PR gprof/13325
* hist.c (hist_assign_samples_1): Make sure that inner loop iterator remains valid.
Diffstat (limited to 'gprof/hist.c')
-rw-r--r--gprof/hist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gprof/hist.c b/gprof/hist.c
index 25364b2..572bacf 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. */