From d678dad434d85c25457fc8c234386f65fae4f07b Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 7 Apr 2011 20:17:11 +0200 Subject: Fix problem in metadata writer It was creating non-multiple-of-four section sizes, which, for some reason, presumably by LLVM, were clipped, rather than padded, to be a multiple of four. --- src/comp/middle/metadata.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/comp') diff --git a/src/comp/middle/metadata.rs b/src/comp/middle/metadata.rs index c3b78662..4c46a307 100644 --- a/src/comp/middle/metadata.rs +++ b/src/comp/middle/metadata.rs @@ -589,6 +589,10 @@ impure fn encode_metadata(@trans.crate_ctxt cx, @ast.crate crate) encode_index[int](ebml_w, items_buckets, int_writer); ebml.end_tag(ebml_w); + // Pad this, since something (LLVM, presumably) is cutting off the + // remaining % 4 bytes. + buf_w.write(vec(0u8, 0u8, 0u8, 0u8)); + ret C_postr(string_w.get_str()); } -- cgit v1.2.3