Skip to content

Commit b0ce693

Browse files
committed
Auto merge of #794 - RalfJung:alignment-sanity, r=oli-obk
ptr-to-int alignment sanity check
2 parents a4495fc + 6886864 commit b0ce693

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/intptrcast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl<'mir, 'tcx> GlobalState {
8989
}
9090
};
9191

92+
debug_assert_eq!(base_addr % alloc.align.bytes(), 0); // sanity check
9293
Ok(base_addr + ptr.offset.bytes())
9394
}
9495

0 commit comments

Comments
 (0)