forked from OSchip/llvm-project
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:
parent
03a3844c66
commit
100f87d655
|
@ -142,8 +142,11 @@ HMapBucket HeaderMap::getBucket(unsigned BucketNo) const {
|
||||||
sizeof(HMapHeader));
|
sizeof(HMapHeader));
|
||||||
|
|
||||||
const HMapBucket *BucketPtr = BucketArray+BucketNo;
|
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.
|
return Result; // Invalid buffer, corrupt hmap.
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise, the bucket is valid. Load the values, bswapping as needed.
|
// Otherwise, the bucket is valid. Load the values, bswapping as needed.
|
||||||
Result.Key = getEndianAdjustedWord(BucketPtr->Key);
|
Result.Key = getEndianAdjustedWord(BucketPtr->Key);
|
||||||
|
|
Loading…
Reference in New Issue