From: Rui Ueyama Date: Fri, 16 Jun 2017 02:17:35 +0000 (+0000) Subject: Fix msan buildbot. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04c012651fdecb300b69ef077d1026f831809b1d;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305541 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/BinaryStreamWriter.cpp b/lib/Support/BinaryStreamWriter.cpp index b22eb1ed12d..9c47a5cf1f7 100644 --- a/lib/Support/BinaryStreamWriter.cpp +++ b/lib/Support/BinaryStreamWriter.cpp @@ -83,6 +83,7 @@ Error BinaryStreamWriter::padToAlignment(uint32_t Align) { uint32_t NewOffset = alignTo(Offset, Align); if (NewOffset > getLength()) return make_error(stream_error_code::stream_too_short); - Offset = NewOffset; + while (Offset < NewOffset) + writeInteger('\0'); return Error::success(); }