From 536cebd7f81b665dbef2ad6f081dcb23349f5576 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sun, 16 Sep 2012 06:18:45 +0000 Subject: [PATCH] Fix dead store found by static analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163994 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/PTHLexer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index bb6e73cc75..b1671721b6 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -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; } -- 2.40.0