summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/Frontend
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-07 04:29:22 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-05-07 04:29:22 +0000
commitd391046930e437d4bb42cfa7c7d70f3302f93c7d (patch)
treee5d61de6b0c6f4d6b3b4798e211c91b12617a31a /clang/lib/Rewrite/Frontend
parent99005e65cd99854ef6844146f8110fc08dba6fe3 (diff)
downloadbcm5719-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.cpp2
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;
}
OpenPOWER on IntegriCloud