Skip to content

Commit b12f96b

Browse files
committed
Differentiate between casted and transmute ptrs
1 parent dd6a9ae commit b12f96b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/intptrcast.rs

+8
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ impl<'mir, 'tcx> GlobalStateInner {
9898
}
9999

100100
pub fn ptr_from_addr(ecx: &MiriEvalContext<'mir, 'tcx>, addr: u64) -> Pointer<Option<Tag>> {
101+
trace!("Transmuting 0x{:x} to a pointer", addr);
102+
103+
// TODO: fix this at some point once we deal with function pointers
104+
// Pointer::new(None, Size::from_bytes(addr))
105+
Self::ptr_from_casted_addr(ecx, addr)
106+
}
107+
108+
pub fn ptr_from_casted_addr(ecx: &MiriEvalContext<'mir, 'tcx>, addr: u64) -> Pointer<Option<Tag>> {
101109
trace!("Casting 0x{:x} to a pointer", addr);
102110
let global_state = ecx.machine.intptrcast.borrow();
103111

0 commit comments

Comments
 (0)