diff options
| author | Rui Ueyama <ruiu@google.com> | 2017-06-16 02:17:35 +0000 |
|---|---|---|
| committer | Rui Ueyama <ruiu@google.com> | 2017-06-16 02:17:35 +0000 |
| commit | 881819ebfbbe3a9df435ef3c27688935c5a36d60 (patch) | |
| tree | ea1dd1aaa3764f3497074bc5e7bef083c7b9c8d5 /llvm/lib/Support | |
| parent | 56312f5ad539872ff20ccf72c7d35028ad539835 (diff) | |
| download | bcm5719-llvm-881819ebfbbe3a9df435ef3c27688935c5a36d60.tar.gz bcm5719-llvm-881819ebfbbe3a9df435ef3c27688935c5a36d60.zip | |
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
Diffstat (limited to 'llvm/lib/Support')
| -rw-r--r-- | llvm/lib/Support/BinaryStreamWriter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/BinaryStreamWriter.cpp b/llvm/lib/Support/BinaryStreamWriter.cpp index b22eb1ed12d..9c47a5cf1f7 100644 --- a/llvm/lib/Support/BinaryStreamWriter.cpp +++ b/llvm/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<BinaryStreamError>(stream_error_code::stream_too_short); - Offset = NewOffset; + while (Offset < NewOffset) + writeInteger('\0'); return Error::success(); } |

