aboutsummaryrefslogtreecommitdiff
path: root/libiberty/sha1.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2013-02-07 04:43:49 +0000
committerDJ Delorie <dj@redhat.com>2013-02-07 04:43:49 +0000
commit0f5f799a26ee1ab0e591247bb54827a9010bd7b9 (patch)
tree9c41ca427b2994bb6a157e46989764060c5df9bb /libiberty/sha1.c
parent1965d5f2d027f2a389ef64079123fe39ab83a034 (diff)
downloadgdb-0f5f799a26ee1ab0e591247bb54827a9010bd7b9.zip
gdb-0f5f799a26ee1ab0e591247bb54827a9010bd7b9.tar.gz
gdb-0f5f799a26ee1ab0e591247bb54827a9010bd7b9.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/sha1.c')
-rw-r--r--libiberty/sha1.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libiberty/sha1.c b/libiberty/sha1.c
index 6a25ab2..617e743 100644
--- a/libiberty/sha1.c
+++ b/libiberty/sha1.c
@@ -300,8 +300,7 @@ sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
length of the file up to 2^64 bits. Here we only compute the
number of bytes. Do a double word increment. */
ctx->total[0] += len;
- if (ctx->total[0] < len)
- ++ctx->total[1];
+ ctx->total[1] += ((len >> 31) >> 1) + (ctx->total[0] < len);
#define rol(x, n) (((x) << (n)) | ((sha1_uint32) (x) >> (32 - (n))))