Don't assume ResultPath is null terminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184824 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Support/PathV2.cpp b/lib/Support/PathV2.cpp
index cc654ee..c0be6f4 100644
--- a/lib/Support/PathV2.cpp
+++ b/lib/Support/PathV2.cpp
@@ -638,7 +638,8 @@
if (close(FD))
return error_code(errno, system_category());
- return fs::remove(ResultPath.begin());
+ StringRef P(ResultPath.begin(), ResultPath.size());
+ return fs::remove(P);
}
error_code make_absolute(SmallVectorImpl<char> &path) {