Skip to content

Commit a87fdb3

Browse files
author
Ellen Arteca
committed
no more holepunch to alloc.bytes
1 parent b8a595d commit a87fdb3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/intptrcast.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,11 @@ impl<'mir, 'tcx> GlobalStateInner {
153153
}
154154

155155
fn alloc_base_addr(ecx: &MiriEvalContext<'mir, 'tcx>, alloc_id: AllocId) -> u64 {
156-
// TODO avoid hole punch
157-
// TODO avoid bytes hole punch
158156
// TODO avoid leaked address hack
159-
let base_addr: u64 = match ecx.get_alloc_raw(alloc_id) {
160-
Ok(ref alloc) => {
161-
let temp = alloc.get_bytes_addr();
162-
// TODO make this a check
163-
assert!(temp.bytes() % 16 == 0);
164-
temp.bytes()
157+
let base_addr: u64 = match ecx.get_alloc_base_addr(alloc_id) {
158+
Ok(addr) => {
159+
assert!(addr.bytes() % 16 == 0);
160+
addr.bytes()
165161
}
166162
// Grabbing u128 for max alignment
167163
Err(_) => Box::leak(Box::new(0u128)) as *const u128 as u64,

0 commit comments

Comments
 (0)