aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-06-19 03:09:38 +0000
committerJordan Rose <jordan_rose@apple.com>2012-06-19 03:09:38 +0000
commit2e413f977d13d83b5baf7b5e4e93fe7c390959ca (patch)
tree8404372ce9556bbc5bbb2772493cec737b696c8f /lib/Basic
parent12b732a86cc2320dd6bc8fd7ef027b619c554f7e (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158699 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r--lib/Basic/SourceManager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 66b06ef6ab..24bd51928c 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/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;
}