From d5705d1b1cc231e2dd121af8b1828980c4ab2d61 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 27 Oct 2012 19:49:20 +0000 Subject: [PATCH] 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! llvm-svn: 166891 --- clang/lib/Parse/Parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index fef903b2fc75..dccdc7ba8e79 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/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; -- 2.34.1