diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-05-07 04:29:22 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-05-07 04:29:22 +0000 |
| commit | d391046930e437d4bb42cfa7c7d70f3302f93c7d (patch) | |
| tree | e5d61de6b0c6f4d6b3b4798e211c91b12617a31a /clang/lib/Rewrite/Frontend | |
| parent | 99005e65cd99854ef6844146f8110fc08dba6fe3 (diff) | |
| download | bcm5719-llvm-d391046930e437d4bb42cfa7c7d70f3302f93c7d.tar.gz bcm5719-llvm-d391046930e437d4bb42cfa7c7d70f3302f93c7d.zip | |
Have SourceManager::getLocForEndOfFile() point at the "EOF" location of the FileID.
This fixes a crash due to SourceManager::getLocForEndOfFile() returning an off-by-one location
when the the FileID is for an empty file.
rdar://13803893
llvm-svn: 181285
Diffstat (limited to 'clang/lib/Rewrite/Frontend')
| -rw-r--r-- | clang/lib/Rewrite/Frontend/InclusionRewriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp index 878be84224a..9e4bb3c89bc 100644 --- a/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp +++ b/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp @@ -464,7 +464,7 @@ bool InclusionRewriter::Process(FileID FileId, RawLex.LexFromRawLexer(RawToken); } OutputContentUpTo(FromFile, NextToWrite, - SM.getFileOffset(SM.getLocForEndOfFile(FileId)) + 1, EOL, Line, + SM.getFileOffset(SM.getLocForEndOfFile(FileId)), EOL, Line, /*EnsureNewline*/true); return true; } |

