aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/RewriteTest.cpp4
-rw-r--r--Rewrite/Rewriter.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 8ff6bc6438..a7f1c209b3 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -195,7 +195,9 @@ void RewriteTest::HandleDeclInMainFile(Decl *D) {
RewriteTest::~RewriteTest() {
// Get the top-level buffer that this corresponds to.
- RewriteTabs();
+
+ // Rewrite tabs if we care.
+ //RewriteTabs();
// Rewrite Objective-c meta data*
std::string ResultStr;
diff --git a/Rewrite/Rewriter.cpp b/Rewrite/Rewriter.cpp
index f068f68ae9..5e6374e9b9 100644
--- a/Rewrite/Rewriter.cpp
+++ b/Rewrite/Rewriter.cpp
@@ -121,7 +121,8 @@ void RewriteBuffer::ReplaceText(unsigned OrigOffset, unsigned OrigLength,
assert(RealOffset+OrigLength <= Buffer.size() && "Invalid location");
// Overwrite the common piece.
- memcpy(&Buffer[RealOffset], NewStr, std::min(OrigLength, NewLength));
+ std::copy(NewStr, NewStr+std::min(OrigLength, NewLength),
+ Buffer.begin()+RealOffset);
// If replacing without shifting around, just overwrite the text.
if (OrigLength == NewLength)