Skip to content

Commit 2341a74

Browse files
committed
---
yaml --- r: 44421 b: refs/heads/master c: c22d0af h: refs/heads/master i: 44419: 7e110ab v: v3
1 parent 134822e commit 2341a74

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d67e144f685783503c1406cb4f28ea19d91d1fec
2+
refs/heads/master: c22d0af14c621a847e71dac7fe0e7fe19bf851a1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/rt/rust_builtin.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,13 @@ debug_opaque(type_desc *t, uint8_t *front) {
241241
rust_task *task = rust_get_current_task();
242242
LOG(task, stdlib, "debug_opaque");
243243
debug_tydesc_helper(t);
244-
// FIXME (#2667) may want to actually account for alignment.
245-
// `front` may not indeed be the front byte of the passed-in
246-
// argument.
247244
for (uintptr_t i = 0; i < t->size; ++front, ++i) {
245+
246+
// Account for alignment. `front` may not indeed be the
247+
// front byte of the passed-in argument
248+
if (((uintptr_t)front % t->align) != 0)
249+
front = (uint8_t *)align_to((uintptr_t)front, (size_t)t->align);
250+
248251
LOG(task, stdlib, " byte %" PRIdPTR ": 0x%" PRIx8, i, *front);
249252
}
250253
}

0 commit comments

Comments
 (0)