diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-12 22:08:56 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-01-12 22:08:56 +0000 |
| commit | 54b2914accb4f5c9b58305fd6da405d20a47c452 (patch) | |
| tree | 1d826bb8c2a6e2a1a775f857021e20f66827f82e | |
| parent | ada22c804cd956f3ee7cc9dc82e6d54ead8a4ffe (diff) | |
| download | bcm5719-llvm-54b2914accb4f5c9b58305fd6da405d20a47c452.tar.gz bcm5719-llvm-54b2914accb4f5c9b58305fd6da405d20a47c452.zip | |
Fix "pointer is null" static analyzer warnings. NFCI.
Use castAs<> instead of getAs<> since the pointers are dereferenced immediately and castAs will perform the null assertion for us.
| -rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 5688042dadd..2b5b74be596 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -270,8 +270,8 @@ static BaseOffset ComputeReturnAdjustmentBaseOffset(ASTContext &Context, const CXXMethodDecl *DerivedMD, const CXXMethodDecl *BaseMD) { - const FunctionType *BaseFT = BaseMD->getType()->getAs<FunctionType>(); - const FunctionType *DerivedFT = DerivedMD->getType()->getAs<FunctionType>(); + const auto *BaseFT = BaseMD->getType()->castAs<FunctionType>(); + const auto *DerivedFT = DerivedMD->getType()->castAs<FunctionType>(); // Canonicalize the return types. CanQualType CanDerivedReturnType = |

