From 999ab5418a769cfcbde7c7291785bb98c5fd2a5f Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Fri, 15 Jun 2012 05:53:35 -0700 Subject: [PATCH] Make the shape interpreter actually advance past fixed length vectors. Closes #2613. --- src/rt/rust_shape.h | 2 ++ src/test/run-pass/fixed_length_vec_glue.rs | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 src/test/run-pass/fixed_length_vec_glue.rs 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(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)"); +}