summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/ObjCMT.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-10 17:18:19 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-01-10 17:21:20 +0000
commitcce4676d6d78ba56e929bd37d65c2667390b68c7 (patch)
tree219999c97fce6f0ec139b6395d3d17144e51b2d8 /clang/lib/ARCMigrate/ObjCMT.cpp
parentcdc9592bf1acb6d8012a4867d2a22458945dcceb (diff)
downloadbcm5719-llvm-cce4676d6d78ba56e929bd37d65c2667390b68c7.tar.gz
bcm5719-llvm-cce4676d6d78ba56e929bd37d65c2667390b68c7.zip
Fix "pointer is null" static analyzer warning. NFCI.
Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
Diffstat (limited to 'clang/lib/ARCMigrate/ObjCMT.cpp')
-rw-r--r--clang/lib/ARCMigrate/ObjCMT.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp
index 8b3a4a3c39c..4c6e9f2432f 100644
--- a/clang/lib/ARCMigrate/ObjCMT.cpp
+++ b/clang/lib/ARCMigrate/ObjCMT.cpp
@@ -1371,7 +1371,7 @@ static bool IsVoidStarType(QualType Ty) {
Ty = TD->getDecl()->getUnderlyingType();
// Is the type void*?
- const PointerType* PT = Ty->getAs<PointerType>();
+ const PointerType* PT = Ty->castAs<PointerType>();
if (PT->getPointeeType().getUnqualifiedType()->isVoidType())
return true;
return IsVoidStarType(PT->getPointeeType());
OpenPOWER on IntegriCloud