diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-03-16 05:58:15 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-03-16 05:58:15 +0000 |
commit | b1279b5c47755dbf655a68965ad6c1c6a678c687 (patch) | |
tree | fde11706622d37bfc29536dd2dacc49f7e776ffb /clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | |
parent | 48c112babe9825246f0283c7abf4b084d1c2dc58 (diff) | |
download | bcm5719-llvm-b1279b5c47755dbf655a68965ad6c1c6a678c687.tar.gz bcm5719-llvm-b1279b5c47755dbf655a68965ad6c1c6a678c687.zip |
Fix analyzer crash on analyzing 'catch' with no condition variable.
llvm-svn: 152900
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index 245f587bac2..a14a491333f 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp @@ -268,6 +268,11 @@ void ExprEngine::VisitCXXCatchStmt(const CXXCatchStmt *CS, ExplodedNode *Pred, ExplodedNodeSet &Dst) { const VarDecl *VD = CS->getExceptionDecl(); + if (!VD) { + Dst.Add(Pred); + return; + } + const LocationContext *LCtx = Pred->getLocationContext(); SVal V = svalBuilder.getConjuredSymbolVal(CS, LCtx, VD->getType(), currentBuilderContext->getCurrentBlockCount()); |