Skip to content

Commit b8a595d

Browse files
author
Ellen Arteca
committed
one level up from full holepunch to alloc bytes
1 parent 33ef561 commit b8a595d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/intptrcast.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,10 @@ impl<'mir, 'tcx> GlobalStateInner {
158158
// TODO avoid leaked address hack
159159
let base_addr: u64 = match ecx.get_alloc_raw(alloc_id) {
160160
Ok(ref alloc) => {
161-
let temp = alloc.bytes.as_ptr() as u64;
162-
assert!(temp % 16 == 0);
163-
temp
161+
let temp = alloc.get_bytes_addr();
162+
// TODO make this a check
163+
assert!(temp.bytes() % 16 == 0);
164+
temp.bytes()
164165
}
165166
// Grabbing u128 for max alignment
166167
Err(_) => Box::leak(Box::new(0u128)) as *const u128 as u64,

0 commit comments

Comments
 (0)