Fix implicit conversion in the lldb Python plugin
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 28 Jan 2020 23:06:33 +0000 (00:06 +0100)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 28 Jan 2020 23:07:50 +0000 (00:07 +0100)
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp

index b659957..92060ee 100644 (file)
@@ -58,7 +58,7 @@ Expected<std::string> python::As<std::string>(Expected<PythonObject> &&obj) {
   auto utf8 = str.AsUTF8();
   if (!utf8)
     return utf8.takeError();
-  return utf8.get();
+  return std::string(utf8.get());
 }
 
 void StructuredPythonObject::Serialize(llvm::json::OStream &s) const {