Author: efriedma
Date: Tue Oct 4 15:31:48 2011
New Revision: 141106
URL: http://llvm.org/viewvc/llvm-project?rev=141106&view=rev
Log:
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
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 @@
RDecl->field_end());
}
- if (NumElements < NumInits)
- NumElements = IList->getNumInits();
-
Result->reserveInits(SemaRef.Context, NumElements);
// Link this new initializer list into the structured initializer
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits