]> granicus.if.org Git - clang/commitdiff
Fix dead store found by static analyzer.
authorTed Kremenek <kremenek@apple.com>
Sun, 16 Sep 2012 06:18:45 +0000 (06:18 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 16 Sep 2012 06:18:45 +0000 (06:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163994 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PTHLexer.cpp

index bb6e73cc75f0828edf6e24eb5a3ef57ae7b68691..b1671721b630505850430e6e3cb6efa0cd432142 100644 (file)
@@ -198,12 +198,11 @@ bool PTHLexer::SkipBlock() {
   assert(LastHashTokPtr && "No known '#' token.");
 
   const unsigned char* HashEntryI = 0;
-  uint32_t Offset;
   uint32_t TableIdx;
 
   do {
     // Read the token offset from the side-table.
-    Offset = ReadLE32(CurPPCondPtr);
+    uint32_t Offset = ReadLE32(CurPPCondPtr);
 
     // Read the target table index from the side-table.
     TableIdx = ReadLE32(CurPPCondPtr);
@@ -223,13 +222,11 @@ bool PTHLexer::SkipBlock() {
         PPCond + TableIdx*(sizeof(uint32_t)*2);
       assert(NextPPCondPtr >= CurPPCondPtr);
       // Read where we should jump to.
-      uint32_t TmpOffset = ReadLE32(NextPPCondPtr);
-      const unsigned char* HashEntryJ = TokBuf + TmpOffset;
+      const unsigned char* HashEntryJ = TokBuf + ReadLE32(NextPPCondPtr);
 
       if (HashEntryJ <= LastHashTokPtr) {
         // Jump directly to the next entry in the side table.
         HashEntryI = HashEntryJ;
-        Offset = TmpOffset;
         TableIdx = ReadLE32(NextPPCondPtr);
         CurPPCondPtr = NextPPCondPtr;
       }