diff options
author | Pavel Labath <pavel@labath.sk> | 2021-03-09 15:15:45 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2021-03-09 15:15:45 +0100 |
commit | 2e826088b9832067994e0348fc768b81632be687 (patch) | |
tree | a6efb8aef637e0d5db72cbd37cef1a790027b6ed /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | |
parent | d0884541ccaa3f80526c99c3fcebbb6155c9ed4c (diff) | |
download | llvm-2e826088b9832067994e0348fc768b81632be687.zip llvm-2e826088b9832067994e0348fc768b81632be687.tar.gz llvm-2e826088b9832067994e0348fc768b81632be687.tar.bz2 |
[lldb] Fix a bug in D96779 (shared lib directory logic)
This function would fail in debug builds, as the two usages of the
LLDB_PYTHON_RELATIVE_LIBDIR macro would expand to two distinct strings.
The path iterator macros don't support that.
Use a temporary variable to ensure everything points to a single string.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index b3f7206..c4cc67c 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -421,8 +421,9 @@ void ScriptInterpreterPython::SharedLibraryDirectoryHelper( if (this_file.GetFileNameExtension() == ConstString(".pyd")) { this_file.RemoveLastPathComponent(); // _lldb.pyd or _lldb_d.pyd this_file.RemoveLastPathComponent(); // lldb - for (auto it = llvm::sys::path::begin(LLDB_PYTHON_RELATIVE_LIBDIR), - end = llvm::sys::path::end(LLDB_PYTHON_RELATIVE_LIBDIR); + llvm::StringRef libdir = LLDB_PYTHON_RELATIVE_LIBDIR; + for (auto it = llvm::sys::path::begin(libdir), + end = llvm::sys::path::end(libdir); it != end; ++it) this_file.RemoveLastPathComponent(); this_file.AppendPathComponent("bin"); |