Skip to content

Commit 3404369

Browse files
committed
Undo bad refactoring
1 parent dce775a commit 3404369

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/intptrcast.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ impl<'mir, 'tcx> GlobalStateInner {
105105
) -> Pointer<Option<Tag>> {
106106
trace!("Casting 0x{:x} to a pointer", addr);
107107

108+
let global_state = ecx.machine.intptrcast.borrow();
109+
108110
// Special-case NULL, it is always an invalid pointer.
109-
if addr == 0 {
111+
if addr == 0 || global_state.provenance_mode == ProvenanceMode::Strict {
110112
return Pointer::new(None, Size::from_bytes(addr));
111113
}
112114

0 commit comments

Comments
 (0)