aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-08 04:09:59 +0000
committerChris Lattner <sabre@nondot.org>2007-11-08 04:09:59 +0000
commit116c08938409b23704b60dd1a78a9243e3621407 (patch)
treeef5cf1d9c85fa17a457145698ae19afe6c916264
parent103fc81f12aa635aa0a573c94b1aceb496b4e587 (diff)
Fix a rewriter bug that fariborz hit, when an @interface was the very very very
first thing in the file. The trick is that text replacement should go after the insert point, not before it, because it will be replacing text after the point, not before it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43879 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--Rewrite/Rewriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Rewrite/Rewriter.cpp b/Rewrite/Rewriter.cpp
index a8bc99fe39..f068f68ae9 100644
--- a/Rewrite/Rewriter.cpp
+++ b/Rewrite/Rewriter.cpp
@@ -117,7 +117,7 @@ void RewriteBuffer::InsertText(unsigned OrigOffset,
/// operation.
void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength,
const char *NewStr, unsigned NewLength) {
- unsigned RealOffset = getMappedOffset(OrigOffset);
+ unsigned RealOffset = getMappedOffset(OrigOffset, true);
assert(RealOffset+OrigLength <= Buffer.size() && "Invalid location");
// Overwrite the common piece.