[Lldb-commits] [lldb] r363770 - Fix a dangling StringRef in FileCollector

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 19 01:09:57 PDT 2019


Author: labath
Date: Wed Jun 19 01:09:56 2019
New Revision: 363770

URL: http://llvm.org/viewvc/llvm-project?rev=363770&view=rev
Log:
Fix a dangling StringRef in FileCollector

FileSpec::GetPath returns a temporary std::string.

Modified:
    lldb/trunk/source/Utility/FileCollector.cpp

Modified: lldb/trunk/source/Utility/FileCollector.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/FileCollector.cpp?rev=363770&r1=363769&r2=363770&view=diff
==============================================================================
--- lldb/trunk/source/Utility/FileCollector.cpp (original)
+++ lldb/trunk/source/Utility/FileCollector.cpp Wed Jun 19 01:09:56 2019
@@ -134,7 +134,7 @@ std::error_code FileCollector::CopyFiles
 std::error_code FileCollector::WriteMapping(const FileSpec &mapping_file) {
   std::lock_guard<std::mutex> lock(m_mutex);
 
-  llvm::StringRef root = m_overlay_root.GetPath();
+  std::string root = m_overlay_root.GetPath();
 
   m_vfs_writer.setOverlayDir(root);
   m_vfs_writer.setCaseSensitivity(IsCaseSensitivePath(root));




More information about the lldb-commits mailing list