Skip to content

Commit 1ee9a83

Browse files
committed
Fix bug in iface shape code
Issue #1437
1 parent f30c5ea commit 1ee9a83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rt/rust_shape.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,10 @@ data<T,U>::walk_iface_value(ptr &dp) {
10051005
type_desc *valtydesc =
10061006
*reinterpret_cast<type_desc **>(body_ptr);
10071007
ptr value_dp(body_ptr + sizeof(void*) * 2);
1008-
T sub(*static_cast<T *>(this), valtydesc->shape + 2, NULL, NULL,
1008+
// FIXME The 5 is a hard-coded way to skip over a struct shape
1009+
// header and the first two (number-typed) fields. This is too
1010+
// fragile, but I didn't see a good way to properly encode it.
1011+
T sub(*static_cast<T *>(this), valtydesc->shape + 5, NULL, NULL,
10091012
value_dp);
10101013
sub.align = true;
10111014
sub.walk();

0 commit comments

Comments
 (0)