From 8d63d5b8e6eb1a372043ecead1be243e9ca31781 Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Tue, 19 Jun 2012 03:09:38 +0000 Subject: Fix the location of the fixit for -Wnewline-eof. It turns out SourceManager treating the "one-past-the-end" location as invalid, but then failing to set the invalid flag properly. llvm-svn: 158699 --- clang/lib/Basic/SourceManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Basic/SourceManager.cpp') diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 66b06ef6ab1..24bd51928c9 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -1015,9 +1015,10 @@ unsigned SourceManager::getColumnNumber(FileID FID, unsigned FilePos, if (MyInvalid) return 1; - if (FilePos >= MemBuf->getBufferSize()) { + // It is okay to request a position just past the end of the buffer. + if (FilePos > MemBuf->getBufferSize()) { if (Invalid) - *Invalid = MyInvalid; + *Invalid = true; return 1; } -- cgit v1.2.3