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 | ce612f5a7d306f919c7ae57fcd8c5ecb5d83d54e (patch) | |
tree | 66c6c8df2d3dcc38cdb5d1416f3cef526e0ce5bd /lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | |
parent | 5214c7a54b85ecd2c1947855732a5c58a2d7cf6c (diff) |
Fix analyzer crash on analyzing 'catch' with no condition variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngineCXX.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/ExprEngineCXX.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp b/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp index 245f587bac..a14a491333 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp +++ b/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()); |