From f9fb2abb01ea82a43b5938e3a24de9d8c6790e46 Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Thu, 3 Nov 2016 18:28:04 +0000 Subject: 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 --- llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/DebugInfo/PDB/Raw/DbiStreamBuilder.cpp') 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 DbiStreamBuilder::createSectionMap( } Expected> -DbiStreamBuilder::build(PDBFile &File, const msf::WritableStream &Buffer) { +DbiStreamBuilder::build(PDBFile &File) { if (!VerHeader.hasValue()) return make_error(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(File, std::move(StreamData)); Dbi->Header = Header; Dbi->FileInfoSubstream = ReadableStreamRef(FileInfoBuffer); -- cgit v1.2.3