[cfe-commits] r57851 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Mon Oct 20 16:13:32 PDT 2008
Author: kremenek
Date: Mon Oct 20 18:13:25 2008
New Revision: 57851
URL: http://llvm.org/viewvc/llvm-project?rev=57851&view=rev
Log:
Used conjured symbols to recover path-sensitivity when the result of a compound assignment is UnknownVal().
Modified:
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57851&r1=57850&r2=57851&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Mon Oct 20 18:13:25 2008
@@ -2204,6 +2204,19 @@
continue;
}
+
+ // EXPERIMENTAL: "Conjured" symbols.
+ // FIXME: Handle structs.
+ QualType T = RHS->getType();
+
+ if (Result.isUnknown() && (T->isIntegerType() || Loc::IsLocType(T))) {
+ unsigned Count = Builder->getCurrentBlockCount();
+ SymbolID Sym = SymMgr.getConjuredSymbol(B->getRHS(), Count);
+
+ Result = Loc::IsLocType(B->getRHS()->getType())
+ ? cast<SVal>(loc::SymbolVal(Sym))
+ : cast<SVal>(nonloc::SymbolVal(Sym));
+ }
EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, Result), location, Result);
}
More information about the cfe-commits
mailing list