diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-09-01 20:35:38 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-09-01 20:35:38 +0000 |
commit | f69cf18aa240b038dfd89f249e63f4cc6e1c5f65 (patch) | |
tree | 23c2143ec938d35fd0adb7889300f500af3dd066 /lib/Checker/CastSizeChecker.cpp | |
parent | 662df6e9e5152be90a746b6b66d9959ba37fdfdd (diff) |
Don't assert in CastSizeChecker when the casted-to pointee is an incomplete type. Fixes PR 8050.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/CastSizeChecker.cpp')
-rw-r--r-- | lib/Checker/CastSizeChecker.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Checker/CastSizeChecker.cpp b/lib/Checker/CastSizeChecker.cpp index a502c10cac..6676fe5e7a 100644 --- a/lib/Checker/CastSizeChecker.cpp +++ b/lib/Checker/CastSizeChecker.cpp @@ -44,6 +44,10 @@ void CastSizeChecker::PreVisitCastExpr(CheckerContext &C, const CastExpr *CE) { QualType ToPointeeTy = ToPTy->getPointeeType(); + // Only perform the check if 'ToPointeeTy' is a complete type. + if (ToPointeeTy->isIncompleteType()) + return; + const GRState *state = C.getState(); const MemRegion *R = state->getSVal(E).getAsRegion(); if (R == 0) |