From 97609bb2fdb1db561b2ca0f32ff4fa413ef4e094 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 10 Jun 2016 21:47:26 +0000 Subject: [pdb] Fix issues with pdb writing. This fixes an alignment issue by forcing all cached allocations to be 8 byte aligned, and also fixes an issue arising on big endian systems by writing ulittle32_t's instead of uint32_t's in the test. llvm-svn: 272437 --- llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp index 86e799ca663..36f8ead090a 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/MappedBlockStream.cpp @@ -104,7 +104,7 @@ Error MappedBlockStream::readBytes(uint32_t Offset, uint32_t Size, // into it, and return an ArrayRef to that. Do not touch existing pool // allocations, as existing clients may be holding a pointer which must // not be invalidated. - uint8_t *WriteBuffer = Pool.Allocate(Size); + uint8_t *WriteBuffer = static_cast(Pool.Allocate(Size, 8)); if (auto EC = readBytes(Offset, MutableArrayRef(WriteBuffer, Size))) return EC; -- cgit v1.2.3