From: Chris Lattner Date: Sat, 27 Oct 2012 19:49:20 +0000 (+0000) Subject: Currently the initial value of Tok is dependent an the stack contents X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b970e9d70768802984f2cf1885e73643c17e0c2;p=clang Currently the initial value of Tok is dependent an the stack contents 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 --- diff --git a/lib/Parse/Parser.cpp b/lib/Parse/Parser.cpp index fef903b2fc..dccdc7ba8e 100644 --- a/lib/Parse/Parser.cpp +++ b/lib/Parse/Parser.cpp @@ -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;