Skip to content

Commit d678dad

Browse files
marijnhgraydon
authored andcommitted
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.
1 parent ac30264 commit d678dad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/comp/middle/metadata.rs

+4
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ impure fn encode_metadata(@trans.crate_ctxt cx, @ast.crate crate)
589589
encode_index[int](ebml_w, items_buckets, int_writer);
590590
ebml.end_tag(ebml_w);
591591

592+
// Pad this, since something (LLVM, presumably) is cutting off the
593+
// remaining % 4 bytes.
594+
buf_w.write(vec(0u8, 0u8, 0u8, 0u8));
595+
592596
ret C_postr(string_w.get_str());
593597
}
594598

0 commit comments

Comments
 (0)