[cfe-commits] r141106 - /cfe/trunk/lib/Sema/SemaInit.cpp

Eli Friedman eli.friedman at gmail.com
Tue Oct 4 13:31:49 PDT 2011

Author: efriedma
Date: Tue Oct  4 15:31:48 2011
New Revision: 141106

URL: http://llvm.org/viewvc/llvm-project?rev=141106&view=rev
Remove a nonsensical bit of code from InitListChecker::getStructuredSubobjectInit which was increasing the reserved size for an init list past its maximum possible size. Fixes PR11056, a case where we were reserving a bunch of memory for arrays that was never actually used.

(No testcase because I don't think we have any way to actually write a testcase for this; the chosen value of NumElements has no effects on anything other than performance and memory usage.)


Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=141106&r1=141105&r2=141106&view=diff
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Tue Oct  4 15:31:48 2011
@@ -2037,9 +2037,6 @@
-  if (NumElements < NumInits)
-    NumElements = IList->getNumInits();
   Result->reserveInits(SemaRef.Context, NumElements);
   // Link this new initializer list into the structured initializer

More information about the cfe-commits mailing list