forked from OSchip/llvm-project
Fix msan buildbot.
This patch should fix sanitizer-x86_64-linux-fast bot. The problem was that the contents of this stream are aligned to 4 byte, and the paddings were created just by incrementing `Offset`, so paddings had undefined values. When the entire stream is written to an output, it triggered msan. llvm-svn: 305541
This commit is contained in:
parent
56312f5ad5
commit
881819ebfb
|
@ -83,6 +83,7 @@ Error BinaryStreamWriter::padToAlignment(uint32_t Align) {
|
|||
uint32_t NewOffset = alignTo(Offset, Align);
|
||||
if (NewOffset > getLength())
|
||||
return make_error<BinaryStreamError>(stream_error_code::stream_too_short);
|
||||
Offset = NewOffset;
|
||||
while (Offset < NewOffset)
|
||||
writeInteger('\0');
|
||||
return Error::success();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue