diff options
| author | Michael Sullivan <sully@msully.net> | 2012-06-15 05:53:35 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2012-06-15 15:31:19 -0700 |
| commit | 999ab5418a769cfcbde7c7291785bb98c5fd2a5f (patch) | |
| tree | aa51311d88c544d764d119345abdf93de3a5dc21 /src | |
| parent | 210db7d8d4d0b65a2ae2b113ef50740c20cbd910 (diff) | |
Make the shape interpreter actually advance past fixed length vectors. Closes #2613.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rt/rust_shape.h | 2 | ||||
| -rw-r--r-- | src/test/run-pass/fixed_length_vec_glue.rs | 6 |
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)"); +} |
