summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DeclSpec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
-rw-r--r--clang/lib/Sema/DeclSpec.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 0f88ed36427..4107977533d 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -223,15 +223,11 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto,
if (!TheDeclarator.InlineStorageUsed &&
NumParams <= llvm::array_lengthof(TheDeclarator.InlineParams)) {
I.Fun.Params = TheDeclarator.InlineParams;
- // Zero the memory block so that unique pointers are initialized
- // properly.
- memset(I.Fun.Params, 0, sizeof(Params[0]) * NumParams);
+ new (I.Fun.Params) ParamInfo[NumParams];
I.Fun.DeleteParams = false;
TheDeclarator.InlineStorageUsed = true;
} else {
- // Call the version of new that zeroes memory so that unique pointers
- // are initialized properly.
- I.Fun.Params = new DeclaratorChunk::ParamInfo[NumParams]();
+ I.Fun.Params = new DeclaratorChunk::ParamInfo[NumParams];
I.Fun.DeleteParams = true;
}
for (unsigned i = 0; i < NumParams; i++)
OpenPOWER on IntegriCloud