diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-08-13 23:32:15 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-08-13 23:32:15 +0000 |
commit | 39e21032cb3be52f5d77df347cd8e91c09fb7250 (patch) | |
tree | 6013faf8a084aeba14b7c7d1b962b1c5f90c836f /lib/StaticAnalyzer/Checkers/UninitializedObject | |
parent | 4fb8974a97cc95e76b5f1c5ac04dc97abc621366 (diff) | |
download | clang-39e21032cb3be52f5d77df347cd8e91c09fb7250.tar.gz |
[analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" fields
Differential Revision: https://reviews.llvm.org/D50673
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339631 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UninitializedObject')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp | 2 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp b/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp index 4da5fa5461..810e066178 100644 --- a/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp @@ -265,7 +265,7 @@ bool FindUninitializedFields::isNonUnionUninit(const TypedValueRegion *R, continue; } - if (T->isPointerType() || T->isReferenceType() || T->isBlockPointerType()) { + if (T->isAnyPointerType() || T->isReferenceType() || T->isBlockPointerType()) { if (isPointerOrReferenceUninit(FR, LocalChain)) ContainsUninitField = true; continue; diff --git a/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp b/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp index 7f08d02894..6c83b2e146 100644 --- a/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp +++ b/lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedPointee.cpp @@ -78,7 +78,7 @@ static bool isVoidPointer(QualType T); bool FindUninitializedFields::isPointerOrReferenceUninit( const FieldRegion *FR, FieldChainInfo LocalChain) { - assert((FR->getDecl()->getType()->isPointerType() || + assert((FR->getDecl()->getType()->isAnyPointerType() || FR->getDecl()->getType()->isReferenceType() || FR->getDecl()->getType()->isBlockPointerType()) && "This method only checks pointer/reference objects!"); |