diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:24:48 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-11 02:24:48 +0000 |
commit | 276c6aca0e9cd2bbd5533493612f67767544d839 (patch) | |
tree | 7a31598d4f68886b91c5f33d2faf23db80f39e19 /lib/Analysis | |
parent | a516ce16b472e61924f5dd10d181c3e8330979af (diff) |
GRExprEngine: For places we might conjure up a new symbol to recover
path-sensitivity, beyond checking to see if the value is "unknown" also check if
the ConstraintManager can handle the SVal. This allows us to recover some
path-sensitivity by actually discarding some information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 222ef173e8..8bc84d4bf5 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1978,7 +1978,8 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) { // Recover some path-sensitivity if a scalar value evaluated to // UnknownVal. - if (InitVal.isUnknown()) { + if (InitVal.isUnknown() || + !getConstraintManager().canReasonAbout(InitVal)) { if (Loc::IsLocType(T)) { SymbolRef Sym = SymMgr.getConjuredSymbol(InitEx, Count); InitVal = loc::SymbolVal(Sym); @@ -2593,8 +2594,10 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, // FIXME: Handle structs. QualType T = RHS->getType(); - if (RightV.isUnknown() && (Loc::IsLocType(T) || - (T->isScalarType() && T->isIntegerType()))) { + if ((RightV.isUnknown() || + !getConstraintManager().canReasonAbout(RightV)) + && (Loc::IsLocType(T) || + (T->isScalarType() && T->isIntegerType()))) { unsigned Count = Builder->getCurrentBlockCount(); SymbolRef Sym = SymMgr.getConjuredSymbol(B->getRHS(), Count); @@ -2604,8 +2607,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, } // Simulate the effects of a "store": bind the value of the RHS - // to the L-Value represented by the LHS. - + // to the L-Value represented by the LHS. EvalStore(Dst, B, LHS, *I2, BindExpr(state, B, RightV), LeftV, RightV); continue; @@ -2760,8 +2762,10 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, SVal LHSVal; - if (Result.isUnknown() && (Loc::IsLocType(CTy) - || (CTy->isScalarType() && CTy->isIntegerType()))) { + if ((Result.isUnknown() || + !getConstraintManager().canReasonAbout(Result)) + && (Loc::IsLocType(CTy) + || (CTy->isScalarType() && CTy->isIntegerType()))) { unsigned Count = Builder->getCurrentBlockCount(); |