diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-04 20:31:48 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-04 20:31:48 +0000 |
commit | 606c1036449c95608c7bf8a39e6924654e2ba38d (patch) | |
tree | 6c8b18409aa808d022f64654b9ad39257c604e43 /clang/lib | |
parent | b1147c46603174d4c8e4d31581205a12138bef64 (diff) | |
download | bcm5719-llvm-606c1036449c95608c7bf8a39e6924654e2ba38d.tar.gz bcm5719-llvm-606c1036449c95608c7bf8a39e6924654e2ba38d.zip |
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.)
llvm-svn: 141106
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaInit.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp index 451abd45346..145a7ecaba4 100644 --- a/clang/lib/Sema/SemaInit.cpp +++ b/clang/lib/Sema/SemaInit.cpp @@ -2037,9 +2037,6 @@ InitListChecker::getStructuredSubobjectInit(InitListExpr *IList, unsigned Index, RDecl->field_end()); } - if (NumElements < NumInits) - NumElements = IList->getNumInits(); - Result->reserveInits(SemaRef.Context, NumElements); // Link this new initializer list into the structured initializer |