Skip to content

Commit e057d48

Browse files
Add null invalid pointer comment
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent d74df11 commit e057d48

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/intptrcast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl<'mir, 'tcx> GlobalStateInner {
109109
trace!("Casting 0x{:x} to a pointer", addr);
110110
let global_state = ecx.machine.intptrcast.borrow();
111111

112+
// Special-case NULL, it is always an invalid pointer.
112113
if addr == 0 || global_state.strict_provenance {
113114
return Pointer::new(None, Size::from_bytes(addr));
114115
}

0 commit comments

Comments
 (0)