llvm/lib/DebugInfo/MSF
Zachary Turner a5be24d937 [PDB] Fix use after free.
Previously MappedBlockStream owned its own BumpPtrAllocator that
it would allocate from when a read crossed a block boundary.  This
way it could still return the user a contiguous buffer of the
requested size.  However, It's not uncommon to open a stream, read
some stuff, close it, and then save the information for later.
After all, since the entire file is mapped into memory, the data
should always be available as long as the file is open.

Of course, the exception to this is when the data isn't *in* the
file, but rather in some buffer that we temporarily allocated to
present this contiguous view.  And this buffer would get destroyed
as soon as the strema was closed.

The fix here is to force the user to specify the allocator, this
way it can provide an allocator that has whatever lifetime it
chooses.

Differential Revision: https://reviews.llvm.org/D33858

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-03 00:33:35 +00:00
..
CMakeLists.txt [Support] Move Stream library from MSF -> Support. 2017-03-02 20:52:51 +00:00
LLVMBuild.txt [msf] Resubmit "Rename Msf -> MSF". 2016-07-29 20:56:36 +00:00
MappedBlockStream.cpp [PDB] Fix use after free. 2017-06-03 00:33:35 +00:00
MSFBuilder.cpp Do not pass a superblock to PDBFileBuilder. 2016-09-30 20:52:12 +00:00
MSFCommon.cpp [PDB] Validate superblock addresses 2016-12-18 00:41:10 +00:00
MSFError.cpp Remove LLVM_NOEXCEPT and replace it with noexcept 2016-10-19 23:52:38 +00:00