diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-09-30 03:51:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-09-30 03:51:54 +0000 |
commit | e4c6675cccbaac991843def43072687bca50d989 (patch) | |
tree | 50b9daa1acb7af1db09ff6428c0abdf3044ca71b /include/clang/Analysis/ProgramPoint.h | |
parent | 0658879cc98e8cb918e2f349a59c901f74f0de11 (diff) |
Fix crash when analyzing C++ code involving constant enums and switch statements (<rdar://problem/10202899>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 8f2b55c9a9..2ff2be9fa1 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -301,7 +301,10 @@ public: class BlockEdge : public ProgramPoint { public: BlockEdge(const CFGBlock *B1, const CFGBlock *B2, const LocationContext *L) - : ProgramPoint(B1, B2, BlockEdgeKind, L) {} + : ProgramPoint(B1, B2, BlockEdgeKind, L) { + assert(B1 && "BlockEdge: source block must be non-null"); + assert(B2 && "BlockEdge: destination block must be non-null"); + } const CFGBlock *getSrc() const { return static_cast<const CFGBlock*>(getData1()); |