summarylogtreecommitdiffstats
path: root/array-of-structure-optimization.patch
blob: 439537a6de01f7c9e2a4801d47686f156e9a5424 (plain)
1
2
3
4
5
6
7
8
9
10
11
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -11166,6 +11166,8 @@ bool ArrayExprEvaluator::VisitCXXConstructExpr(const CXXConstructExpr *E,
   if (const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(Type)) {
     unsigned FinalSize = CAT->getSize().getZExtValue();
 
+    if (FinalSize > 64) return false;
+
     // Preserve the array filler if we had prior zero-initialization.
     APValue Filler =
       HadZeroInit && Value->hasArrayFiller() ? Value->getArrayFiller()