]> granicus.if.org Git - clang/commitdiff
Fixed a problem in r19589.
authorTyler Nowicki <tyler.nowicki@gmail.com>
Sun, 12 Oct 2014 21:28:02 +0000 (21:28 +0000)
committerTyler Nowicki <tyler.nowicki@gmail.com>
Sun, 12 Oct 2014 21:28:02 +0000 (21:28 +0000)
Several systems failed to compile the array allocation of the TokenArray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219590 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParsePragma.cpp

index 55919fd50bebd9a1312f6fdaea2ff2b73caa879f..7f19abf89e11e35cdda9bad2d33a51a19ce878a1 100644 (file)
@@ -1877,8 +1877,8 @@ static bool ParseLoopHintValue(Preprocessor &PP, Token &Tok, Token PragmaName,
   EOFTok.setLocation(Tok.getLocation());
   ValueList.push_back(EOFTok); // Terminates expression for parsing.
 
-  Token *TokenArray =
-      new (PP.getPreprocessorAllocator()) Token[ValueList.size()];
+  Token *TokenArray = (Token *)PP.getPreprocessorAllocator().Allocate(
+      ValueList.size() * sizeof(Token), llvm::alignOf<Token>());
   std::copy(ValueList.begin(), ValueList.end(), TokenArray);
   Info.Toks = TokenArray;
   Info.TokSize = ValueList.size();