Skip to content

Commit 999ab54

Browse files
committed
Make the shape interpreter actually advance past fixed length vectors. Closes #2613.
1 parent 210db7d commit 999ab54

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/rt/rust_shape.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,9 @@ class data : public ctxt< data<T,U> > {
923923
void walk_fixedvec1(uint16_t n_elts, bool is_pod) {
924924
size_align sa = size_of::get(*this);
925925
ALIGN_TO(sa.alignment);
926+
U next_dp = dp + (n_elts * sa.size);
926927
static_cast<T *>(this)->walk_fixedvec2(n_elts, sa.size, is_pod);
928+
dp = next_dp;
927929
}
928930

929931
void walk_box1() { DATA_SIMPLE(void *, walk_box2()); }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
let arr = [1,2,3]/3;
3+
let struct = {a: 13u8, b: arr, c: 42};
4+
let s = sys::log_str(struct);
5+
assert(s == "(13, [1, 2, 3]/3, 42)");
6+
}

0 commit comments

Comments
 (0)