From: Simon Pilgrim Date: Fri, 10 Jan 2020 17:40:34 +0000 (+0000) Subject: Fix "pointer is null" static analyzer warning. NFCI. X-Git-Tag: llvmorg-11-init~418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fd8ded99fe6e9fcae2c98ccad25d6562c5fa8a14;p=platform%2Fupstream%2Fllvm.git 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. --- diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index c22504c..a8dce3c 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/lib/CodeGen/CGVTables.cpp @@ -336,7 +336,7 @@ void CodeGenFunction::EmitCallAndReturnForThunk(llvm::FunctionCallee Callee, for (const ParmVarDecl *PD : MD->parameters()) EmitDelegateCallArg(CallArgs, PD, SourceLocation()); - const FunctionProtoType *FPT = MD->getType()->getAs(); + const FunctionProtoType *FPT = MD->getType()->castAs(); #ifndef NDEBUG const CGFunctionInfo &CallFnInfo = CGM.getTypes().arrangeCXXMethodCall(