aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarijn Haverbeke <[email protected]>2011-04-07 20:17:11 +0200
committerGraydon Hoare <[email protected]>2011-04-07 14:19:17 -0700
commitd678dad434d85c25457fc8c234386f65fae4f07b (patch)
treedf8f01bd3b5a1abc56deee78c0f1d77866e49bb1 /src
parentRevise EBML reader API (diff)
downloadrust-d678dad434d85c25457fc8c234386f65fae4f07b.tar.xz
rust-d678dad434d85c25457fc8c234386f65fae4f07b.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/comp/middle/metadata.rs4
1 files changed, 4 insertions, 0 deletions
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());
}