From: Ted Kremenek Date: Mon, 20 Oct 2008 23:13:25 +0000 (+0000) Subject: Used conjured symbols to recover path-sensitivity when the result of a compound assig... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ff267d0d6b8249a017fca0b56a0c5a6bcb7ef8a;p=clang Used conjured symbols to recover path-sensitivity when the result of a compound assignment is UnknownVal(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57851 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 98fa58f5dd..94fbf35b1b 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -2204,6 +2204,19 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, 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(loc::SymbolVal(Sym)) + : cast(nonloc::SymbolVal(Sym)); + } EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, Result), location, Result); }