From c49018d9cce52d8c9f34b44865ec3ba8e89a1488 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Jun 2011 15:46:16 +0000 Subject: Vendor import of clang trunk r132879: http://llvm.org/svn/llvm-project/cfe/trunk@132879 --- lib/Lex/Lexer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Lex/Lexer.cpp') diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp index 16cc4f8..3b1149c 100644 --- a/lib/Lex/Lexer.cpp +++ b/lib/Lex/Lexer.cpp @@ -76,7 +76,8 @@ void Lexer::InitLexer(const char *BufStart, const char *BufPtr, // skip the UTF-8 BOM if it's present. if (BufferStart == BufferPtr) { // Determine the size of the BOM. - size_t BOMLength = llvm::StringSwitch(BufferStart) + llvm::StringRef Buf(BufferStart, BufferEnd - BufferStart); + size_t BOMLength = llvm::StringSwitch(Buf) .StartsWith("\xEF\xBB\xBF", 3) // UTF-8 BOM .Default(0); -- cgit v1.1