]> granicus.if.org Git - clang/commitdiff
[Analyzer] Second fix for last commit for IteratorChecker
authorAdam Balogh <adam.balogh@ericsson.com>
Tue, 23 Apr 2019 11:18:50 +0000 (11:18 +0000)
committerAdam Balogh <adam.balogh@ericsson.com>
Tue, 23 Apr 2019 11:18:50 +0000 (11:18 +0000)
A variable was redeclared instead of assigned in an internal
block, leaving the original uninitialized. This is fixed now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358971 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/IteratorChecker.cpp

index e35bc2768a3bcced7840107142772554aa794efa..cfa408720c0427f76b33282e666b4b323a04fd86 100644 (file)
@@ -825,7 +825,7 @@ void IteratorChecker::handleComparison(CheckerContext &C, const Expr *CE,
   SymbolRef Sym;
   if (!LPos || !RPos) {
     auto &SymMgr = C.getSymbolManager();
-    auto Sym = SymMgr.conjureSymbol(CE, C.getLocationContext(),
+    Sym = SymMgr.conjureSymbol(CE, C.getLocationContext(),
                                C.getASTContext().LongTy, C.blockCount());
     State = assumeNoOverflow(State, Sym, 4);
   }