Initialize Suffix and Prefix to 0, even with a bad entry. Removes an uninitialized value warning from gcc.

llvm-svn: 58305
This commit is contained in:
Ted Kremenek 2008-10-28 00:18:42 +00:00
parent 03a3844c66
commit 100f87d655
1 changed files with 4 additions and 1 deletions

View File

@ -142,8 +142,11 @@ HMapBucket HeaderMap::getBucket(unsigned BucketNo) const {
sizeof(HMapHeader));
const HMapBucket *BucketPtr = BucketArray+BucketNo;
if ((char*)(BucketPtr+1) > FileBuffer->getBufferEnd())
if ((char*)(BucketPtr+1) > FileBuffer->getBufferEnd()) {
Result.Prefix = 0;
Result.Suffix = 0;
return Result; // Invalid buffer, corrupt hmap.
}
// Otherwise, the bucket is valid. Load the values, bswapping as needed.
Result.Key = getEndianAdjustedWord(BucketPtr->Key);