diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-06-19 03:09:38 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-06-19 03:09:38 +0000 |
commit | 8d63d5b8e6eb1a372043ecead1be243e9ca31781 (patch) | |
tree | 76e09445e9177892033e7ce5c2e445756685cd4d /clang/lib/Basic/SourceManager.cpp | |
parent | 1cc27e44a4d7304851d42a2150a3f02db923e8c4 (diff) | |
download | bcm5719-llvm-8d63d5b8e6eb1a372043ecead1be243e9ca31781.tar.gz bcm5719-llvm-8d63d5b8e6eb1a372043ecead1be243e9ca31781.zip |
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
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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; } |