diff options
Diffstat (limited to 'lib/Lex/Lexer.cpp')
| -rw-r--r-- | lib/Lex/Lexer.cpp | 12 | 
1 files changed, 3 insertions, 9 deletions
| diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index ca5252e1c9ce..3f89ea649cbb 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -143,14 +143,8 @@ Lexer::Lexer(SourceLocation fileloc, const LangOptions &langOpts,  /// range will outlive it, so it doesn't take ownership of it.  Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *FromFile,               const SourceManager &SM, const LangOptions &langOpts) -  : FileLoc(SM.getLocForStartOfFile(FID)), LangOpts(langOpts) { - -  InitLexer(FromFile->getBufferStart(), FromFile->getBufferStart(), -            FromFile->getBufferEnd()); - -  // We *are* in raw mode. -  LexingRawMode = true; -} +    : Lexer(SM.getLocForStartOfFile(FID), langOpts, FromFile->getBufferStart(), +            FromFile->getBufferStart(), FromFile->getBufferEnd()) {}  /// Create_PragmaLexer: Lexer constructor - Create a new lexer object for  /// _Pragma expansion.  This has a variety of magic semantics that this method @@ -1860,7 +1854,7 @@ bool Lexer::LexAngledStringLiteral(Token &Result, const char *CurPtr) {    char C = getAndAdvanceChar(CurPtr, Result);    while (C != '>') {      // Skip escaped characters. -    if (C == '\\') { +    if (C == '\\' && CurPtr < BufferEnd) {        // Skip the escaped character.        getAndAdvanceChar(CurPtr, Result);      } else if (C == '\n' || C == '\r' ||             // Newline. | 
