summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorYaxun Liu <Yaxun.Liu@amd.com>2016-12-15 08:09:08 +0000
committerYaxun Liu <Yaxun.Liu@amd.com>2016-12-15 08:09:08 +0000
commit402804b6d67c880c97e575342189025fe28c0f81 (patch)
treef05c793f67afb7f12b82a43b0926afd04c0ae4ec /clang/lib/CodeGen/CGExprAgg.cpp
parent61ef150d53e4a9a3f14f614991f8132a5bb4eedc (diff)
downloadbcm5719-llvm-402804b6d67c880c97e575342189025fe28c0f81.tar.gz
bcm5719-llvm-402804b6d67c880c97e575342189025fe28c0f81.zip
Re-commit r289252 and r289285, and fix PR31374
llvm-svn: 289787
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index e24a0853c80..35148bea001 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -1052,7 +1052,8 @@ static bool isSimpleZero(const Expr *E, CodeGenFunction &CGF) {
return true;
// (int*)0 - Null pointer expressions.
if (const CastExpr *ICE = dyn_cast<CastExpr>(E))
- return ICE->getCastKind() == CK_NullToPointer;
+ return ICE->getCastKind() == CK_NullToPointer &&
+ CGF.getTypes().isPointerZeroInitializable(E->getType());
// '\0'
if (const CharacterLiteral *CL = dyn_cast<CharacterLiteral>(E))
return CL->getValue() == 0;
OpenPOWER on IntegriCloud