From: Richard Smith Date: Thu, 23 Apr 2015 04:13:52 +0000 (+0000) Subject: [modules] Actually allocate the extra space we use for the tail-allocated array X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2b3c4751bd86c1998c854026594c21b251f4da2;p=clang [modules] Actually allocate the extra space we use for the tail-allocated array in this class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235570 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/MacroInfo.cpp b/lib/Lex/MacroInfo.cpp index 046948397f..55e0049e5e 100644 --- a/lib/Lex/MacroInfo.cpp +++ b/lib/Lex/MacroInfo.cpp @@ -237,7 +237,9 @@ void MacroDirective::dump() const { ModuleMacro *ModuleMacro::create(Preprocessor &PP, unsigned OwningModuleID, IdentifierInfo *II, MacroInfo *Macro, - ArrayRef Overrides) { - return new (PP.getPreprocessorAllocator()) - ModuleMacro(OwningModuleID, II, Macro, Overrides); + ArrayRef Overrides) { + void *Mem = PP.getPreprocessorAllocator().Allocate( + sizeof(ModuleMacro) + sizeof(ModuleMacro *) * Overrides.size(), + llvm::alignOf()); + return new (Mem) ModuleMacro(OwningModuleID, II, Macro, Overrides); }