diff options
author | Zachary Turner <zturner@google.com> | 2018-12-19 19:45:30 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-12-19 19:45:30 +0000 |
commit | 51f88af359dae51e79fea5bfef3904a463a6541c (patch) | |
tree | 33d25aa71a4093e68e8b53203ada45e07845489b /lldb | |
parent | e4fa9b06f334156d846b9a38aff1822a8612d9c0 (diff) | |
download | bcm5719-llvm-51f88af359dae51e79fea5bfef3904a463a6541c.tar.gz bcm5719-llvm-51f88af359dae51e79fea5bfef3904a463a6541c.zip |
[NativePDB] Fix a use after free and enable corresponding native test.
We had a use after free where we were assigning the result of a function
that returned a string to a StringRef. After fixing this use after
free, one of the DIA PDB tests now passes with the native PDB reader,
so we enable the test under native mode as well. The goal is to
eventually make all the tests pass under both, at which point we can
disable them all under DIA mode.
llvm-svn: 349673
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/lit/SymbolFile/PDB/compilands.test | 3 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lldb/lit/SymbolFile/PDB/compilands.test b/lldb/lit/SymbolFile/PDB/compilands.test index 7250383e3d5..bda2004e498 100644 --- a/lldb/lit/SymbolFile/PDB/compilands.test +++ b/lldb/lit/SymbolFile/PDB/compilands.test @@ -1,7 +1,8 @@ REQUIRES: system-windows, msvc RUN: %build --compiler=clang-cl --mode=compile --arch=32 --nodefaultlib --output=%T/CompilandsTest.cpp.obj %S/Inputs/CompilandsTest.cpp RUN: %build --compiler=msvc --mode=link --arch=32 --nodefaultlib --output=%T/CompilandsTest.cpp.exe %T/CompilandsTest.cpp.obj -RUN: lldb-test symbols %T/CompilandsTest.cpp.exe | FileCheck %s +RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols %T/CompilandsTest.cpp.exe | FileCheck %s +RUN: env LLDB_USE_NATIVE_PDB_READER=0 lldb-test symbols %T/CompilandsTest.cpp.exe | FileCheck %s ; Link default libraries diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index fa168899802..bd44474facb 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -419,7 +419,7 @@ SymbolFileNativePDB::CreateCompileUnit(const CompilandIndexItem &cci) { if (cci.m_compile_opts && cci.m_compile_opts->hasOptimizations()) optimized = eLazyBoolYes; - llvm::StringRef source_file_name = + llvm::SmallString<64> source_file_name = m_index->compilands().GetMainSourceFile(cci); FileSpec fs(source_file_name); |