diff options
author | Justin Bogner <mail@justinbogner.com> | 2016-11-03 18:28:04 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2016-11-03 18:28:04 +0000 |
commit | f9fb2abb01ea82a43b5938e3a24de9d8c6790e46 (patch) | |
tree | 757660f33ba2e98112616b8b9ac1a931ea0a115f /llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp | |
parent | 271194016acfe2b4eb51733ee7938abf81245cdd (diff) | |
download | bcm5719-llvm-f9fb2abb01ea82a43b5938e3a24de9d8c6790e46.tar.gz bcm5719-llvm-f9fb2abb01ea82a43b5938e3a24de9d8c6790e46.zip |
PDB: Fix some APIs to avoid use-after-frees
The buffer is already owned by the PDBFile for all of these APIs, so
don't pass it in separately.
llvm-svn: 285953
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp index 4ee28c7d811..6067e5ce842 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp @@ -328,15 +328,15 @@ std::vector<SecMapEntry> DbiStreamBuilder::createSectionMap( } Expected<std::unique_ptr<DbiStream>> -DbiStreamBuilder::build(PDBFile &File, const msf::WritableStream &Buffer) { +DbiStreamBuilder::build(PDBFile &File) { if (!VerHeader.hasValue()) return make_error<RawError>(raw_error_code::unspecified, "Missing DBI Stream Version"); if (auto EC = finalize()) return std::move(EC); - auto StreamData = MappedBlockStream::createIndexedStream(File.getMsfLayout(), - Buffer, StreamDBI); + auto StreamData = MappedBlockStream::createIndexedStream( + File.getMsfLayout(), File.getMsfBuffer(), StreamDBI); auto Dbi = llvm::make_unique<DbiStream>(File, std::move(StreamData)); Dbi->Header = Header; Dbi->FileInfoSubstream = ReadableStreamRef(FileInfoBuffer); |