From f7133b797749c4edd91d4ddd8a7a64e319650fad Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 1 Oct 2019 21:50:30 +0000 Subject: [PATCH] CGExprAgg - remove duplicate code. NFCI. Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning. llvm-svn: 373396 --- clang/lib/CodeGen/CGExprAgg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 0a57870..9610a04 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -1759,7 +1759,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) { // referencee. InitListExprs for unions and arrays can't have references. if (const RecordType *RT = E->getType()->getAs()) { if (!RT->isUnionType()) { - RecordDecl *SD = E->getType()->getAs()->getDecl(); + RecordDecl *SD = RT->getDecl(); CharUnits NumNonZeroBytes = CharUnits::Zero(); unsigned ILEElement = 0; -- 2.7.4