about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/rt/rust_shape.h2
-rw-r--r--src/test/run-pass/fixed_length_vec_glue.rs6
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h
index 8766759cc41..0de19321050 100644
--- a/src/rt/rust_shape.h
+++ b/src/rt/rust_shape.h
@@ -923,7 +923,9 @@ public:
     void walk_fixedvec1(uint16_t n_elts, bool is_pod) {
         size_align sa = size_of::get(*this);
         ALIGN_TO(sa.alignment);
+        U next_dp = dp + (n_elts * sa.size);
         static_cast<T *>(this)->walk_fixedvec2(n_elts, sa.size, is_pod);
+        dp = next_dp;
     }
 
     void walk_box1() { DATA_SIMPLE(void *, walk_box2()); }
diff --git a/src/test/run-pass/fixed_length_vec_glue.rs b/src/test/run-pass/fixed_length_vec_glue.rs
new file mode 100644
index 00000000000..b8d894bef7d
--- /dev/null
+++ b/src/test/run-pass/fixed_length_vec_glue.rs
@@ -0,0 +1,6 @@
+fn main() {
+    let arr = [1,2,3]/3;
+    let struct = {a: 13u8, b: arr, c: 42};
+    let s = sys::log_str(struct);
+    assert(s == "(13, [1, 2, 3]/3, 42)");
+}