diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 01:27:57 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-02-28 01:27:57 +0000 |
| commit | 4f7745a3b1421c8559d810e3fa8b5f974f69cc7d (patch) | |
| tree | 9021035ab460a2be67318ad11e6e1a70a31bbbc8 /clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp | |
| parent | 68ed625bd30054a566082c3e6377c4402f1f2188 (diff) | |
| download | bcm5719-llvm-4f7745a3b1421c8559d810e3fa8b5f974f69cc7d.tar.gz bcm5719-llvm-4f7745a3b1421c8559d810e3fa8b5f974f69cc7d.zip | |
[analyzer] ExprEngine should not depend on checkers for not crashing.
llvm-svn: 126622
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp index fc33639a862..004be0c1b15 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ExprEngine.cpp @@ -1322,7 +1322,7 @@ void ExprEngine::processBranch(const Stmt* Condition, const Stmt* Term, const GRState* PrevState = builder.getState(); SVal X = PrevState->getSVal(Condition); - if (X.isUnknown()) { + if (X.isUnknownOrUndef()) { // Give it a chance to recover from unknown. if (const Expr *Ex = dyn_cast<Expr>(Condition)) { if (Ex->getType()->isIntegerType()) { @@ -1340,7 +1340,7 @@ void ExprEngine::processBranch(const Stmt* Condition, const Stmt* Term, } } // If the condition is still unknown, give up. - if (X.isUnknown()) { + if (X.isUnknownOrUndef()) { builder.generateNode(MarkBranch(PrevState, Term, true), true); builder.generateNode(MarkBranch(PrevState, Term, false), false); return; @@ -1858,7 +1858,8 @@ void ExprEngine::evalStore(ExplodedNodeSet& Dst, const Expr *AssignE, if (Tmp.empty()) return; - assert(!location.isUndef()); + if (location.isUndef()) + return; SaveAndRestore<ProgramPoint::Kind> OldSPointKind(Builder->PointKind, ProgramPoint::PostStoreKind); @@ -1918,7 +1919,8 @@ void ExprEngine::evalLoadCommon(ExplodedNodeSet& Dst, const Expr *Ex, if (Tmp.empty()) return; - assert(!location.isUndef()); + if (location.isUndef()) + return; SaveAndRestore<ProgramPoint::Kind> OldSPointKind(Builder->PointKind); |

