Skip to content

Commit f7133b7

Browse files
committed
CGExprAgg - remove duplicate code. NFCI.
Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning. llvm-svn: 373396
1 parent ed11786 commit f7133b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CGExprAgg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,7 @@ static CharUnits GetNumNonZeroBytesInInit(const Expr *E, CodeGenFunction &CGF) {
17591759
// referencee. InitListExprs for unions and arrays can't have references.
17601760
if (const RecordType *RT = E->getType()->getAs<RecordType>()) {
17611761
if (!RT->isUnionType()) {
1762-
RecordDecl *SD = E->getType()->getAs<RecordType>()->getDecl();
1762+
RecordDecl *SD = RT->getDecl();
17631763
CharUnits NumNonZeroBytes = CharUnits::Zero();
17641764

17651765
unsigned ILEElement = 0;

0 commit comments

Comments
 (0)