diff options
| author | George Karpenkov <ekarpenkov@apple.com> | 2017-10-11 19:13:15 +0000 |
|---|---|---|
| committer | George Karpenkov <ekarpenkov@apple.com> | 2017-10-11 19:13:15 +0000 |
| commit | 734cad8790a1ff0b3c246a5629747075057c1ded (patch) | |
| tree | 95a510b238081fa598bc57ab146fb25c0120fc94 /clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp | |
| parent | 5acfd1dd78f2485cef0dc3f5968d0ddf57ea6629 (diff) | |
| download | bcm5719-llvm-734cad8790a1ff0b3c246a5629747075057c1ded.tar.gz bcm5719-llvm-734cad8790a1ff0b3c246a5629747075057c1ded.zip | |
[Analyzer] Fix introduced regression: properly check for nullable attribute.
llvm-svn: 315492
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp')
| -rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp index 47b33045416..516544b0f5c 100644 --- a/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/NonnullStringConstantsChecker.cpp @@ -122,7 +122,8 @@ bool NonnullStringConstantsChecker::isStringlike(QualType Ty) const { return true; if (auto *T = dyn_cast<ObjCObjectPointerType>(Ty)) { - return T->getInterfaceDecl()->getIdentifier() == NSStringII; + return T->getInterfaceDecl() && + T->getInterfaceDecl()->getIdentifier() == NSStringII; } else if (auto *T = dyn_cast<TypedefType>(Ty)) { return T->getDecl()->getIdentifier() == CFStringRefII; } |

