From: Argyrios Kyrtzidis Date: Sat, 19 Jun 2010 19:58:34 +0000 (+0000) Subject: Cure for Doug's insomnia. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f9359f5ae1227f3b489d1d261225d8180b64ed3;p=clang Cure for Doug's insomnia. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106394 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index e765a06087..bc95049ec5 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -151,7 +151,7 @@ void Parser::ParseLexedMethodDeclarations(ParsingClass &Class) { "ParseAssignmentExpression went over the default arg tokens!"); // There could be leftover tokens (e.g. because of an error). // Skip through until we reach the original token position. - while (Tok.getLocation() != origLoc) + while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) ConsumeAnyToken(); delete Toks; @@ -218,7 +218,7 @@ void Parser::ParseLexedMethodDefs(ParsingClass &Class) { "ParseFunctionTryBlock went over the cached tokens!"); // There could be leftover tokens (e.g. because of an error). // Skip through until we reach the original token position. - while (Tok.getLocation() != origLoc) + while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) ConsumeAnyToken(); continue; } @@ -243,7 +243,7 @@ void Parser::ParseLexedMethodDefs(ParsingClass &Class) { // expensive isBeforeInTranslationUnit call. if (PP.getSourceManager().isBeforeInTranslationUnit(Tok.getLocation(), origLoc)) - while (Tok.getLocation() != origLoc) + while (Tok.getLocation() != origLoc && Tok.isNot(tok::eof)) ConsumeAnyToken(); }