[lldb] Remove FileSpec(FileSpec*) constructor

This constructor was the cause of some pretty weird behavior. Remove it,
and update all code to properly dereference the argument instead.
This commit is contained in:
Pavel Labath
2019-11-28 17:02:07 +01:00
parent 16d2013044
commit 28e4942b2c
9 changed files with 21 additions and 42 deletions

View File

@@ -114,9 +114,10 @@ const char *ObjectFilePECOFF::GetPluginDescriptionStatic() {
ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
DataBufferSP &data_sp,
lldb::offset_t data_offset,
const lldb_private::FileSpec *file,
const lldb_private::FileSpec *file_p,
lldb::offset_t file_offset,
lldb::offset_t length) {
FileSpec file = file_p ? *file_p : FileSpec();
if (!data_sp) {
data_sp = MapFileData(file, length, file_offset);
if (!data_sp)
@@ -135,7 +136,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
}
auto objfile_up = std::make_unique<ObjectFilePECOFF>(
module_sp, data_sp, data_offset, file, file_offset, length);
module_sp, data_sp, data_offset, file_p, file_offset, length);
if (!objfile_up || !objfile_up->ParseHeader())
return nullptr;