]> granicus.if.org Git - clang/commitdiff
Currently the initial value of Tok is dependent an the stack contents
authorChris Lattner <sabre@nondot.org>
Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!

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

lib/Parse/Parser.cpp

index fef903b2fc75511a7440e3bc979db43768d20fc6..dccdc7ba8e79e3d828514e4306ef556a603d873d 100644 (file)
@@ -53,6 +53,7 @@ Parser::Parser(Preprocessor &pp, Sema &actions, bool SkipFunctionBodies)
     GreaterThanIsOperator(true), ColonIsSacred(false), 
     InMessageExpression(false), TemplateParameterDepth(0),
     ParsingInObjCContainer(false), SkipFunctionBodies(SkipFunctionBodies) {
+  Tok.startToken();
   Tok.setKind(tok::eof);
   Actions.CurScope = 0;
   NumCachedScopes = 0;