Skip to content

Commit 6886864

Browse files
committed
ptr-to-int alignment sanity check
1 parent a4495fc commit 6886864

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)