diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-20 23:13:25 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-20 23:13:25 +0000 |
commit | 9ff267d0d6b8249a017fca0b56a0c5a6bcb7ef8a (patch) | |
tree | 375d13bf996447e1d33a3a5140018f77bb1376e3 /lib/Analysis/GRExprEngine.cpp | |
parent | 18bc164e649bfc1909102e16d3d99836da65da4a (diff) |
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
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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<SVal>(loc::SymbolVal(Sym)) + : cast<SVal>(nonloc::SymbolVal(Sym)); + } EvalStore(Dst, B, LHS, *I3, SetSVal(St, B, Result), location, Result); } |