We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0b44ca commit 9b66527Copy full SHA for 9b66527
src/intptrcast.rs
@@ -84,7 +84,8 @@ impl<'mir, 'tcx> GlobalState {
84
// Leave some space to the previous allocation, to give it some chance to be less aligned.
85
let slack = {
86
let mut rng = memory.extra.rng.as_ref().unwrap().borrow_mut();
87
- rng.gen_range(0, align)
+ // This means that `(global_state.next_base_addr + slack) % 16` is uniformly distributed.
88
+ rng.gen_range(0, 16)
89
};
90
// From next_base_addr + slack, round up to adjust for alignment.
91
let base_addr = Self::align_addr(global_state.next_base_addr + slack, align);
0 commit comments