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:
Rui Ueyama 2017-06-16 02:17:35 +00:00
parent 56312f5ad5
commit 881819ebfb
1 changed files with 2 additions and 1 deletions

View File

@ -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();
}