aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-07-03 14:10:23 +0000
commit145449b1e420787bb99721a429341fa6be3adfb6 (patch)
tree1d56ae694a6de602e348dd80165cf881a36600ed /llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
parentecbca9f5fb7d7613d2b94982c4825eb0d33d6842 (diff)
Diffstat (limited to 'llvm/lib/Demangle/MicrosoftDemangleNodes.cpp')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangleNodes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
index d07d05a08c55..494cdabad41f 100644
--- a/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp
@@ -121,8 +121,8 @@ std::string Node::toString(OutputFlags Flags) const {
OutputBuffer OB;
initializeOutputBuffer(nullptr, nullptr, OB, 1024);
this->output(OB, Flags);
- OB << '\0';
- std::string Owned(OB.getBuffer());
+ StringView SV = OB;
+ std::string Owned(SV.begin(), SV.end());
std::free(OB.getBuffer());
return Owned;
}