[cfe-commits] r58305 - /cfe/trunk/lib/Lex/HeaderMap.cpp
Ted Kremenek
kremenek at apple.com
Mon Oct 27 17:18:42 PDT 2008
Author: kremenek
Date: Mon Oct 27 19:18:42 2008
New Revision: 58305
URL: http://llvm.org/viewvc/llvm-project?rev=58305&view=rev
Log:
Initialize Suffix and Prefix to 0, even with a bad entry. Removes an uninitialized value warning from gcc.
Modified:
cfe/trunk/lib/Lex/HeaderMap.cpp
Modified: cfe/trunk/lib/Lex/HeaderMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/HeaderMap.cpp?rev=58305&r1=58304&r2=58305&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/HeaderMap.cpp (original)
+++ cfe/trunk/lib/Lex/HeaderMap.cpp Mon Oct 27 19:18:42 2008
@@ -142,8 +142,11 @@
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);
More information about the cfe-commits
mailing list