diff --git a/src/rt/rust_shape.h b/src/rt/rust_shape.h index 789d54c71fa9..d8bb6b64c8ff 100644 --- a/src/rt/rust_shape.h +++ b/src/rt/rust_shape.h @@ -775,8 +775,9 @@ public: void walk_fn(bool align) { if (align) dp = align_to(dp, sizeof(void *)); + U next_dp = dp + sizeof(void *) * 2; static_cast(this)->walk_fn(align); - dp += sizeof(void *) * 2; + dp = next_dp; } void walk_obj(bool align) {