1
Fork 0

Insert null checks for pointer dereferences when debug assertions are enabled

Similar to how the alignment is already checked, this adds a check
for null pointer dereferences in debug mode. It is implemented similarly
to the alignment check as a MirPass.

This is related to a 2025H1 project goal for better UB checks in debug
mode: https://github.com/rust-lang/rust-project-goals/pull/177.
This commit is contained in:
Bastian Kersting 2024-12-17 13:00:22 +00:00
parent 851322b74d
commit b151b513ba
32 changed files with 281 additions and 6 deletions

View file

@ -1476,6 +1476,7 @@ symbols! {
panic_location,
panic_misaligned_pointer_dereference,
panic_nounwind,
panic_null_pointer_dereference,
panic_runtime,
panic_str_2015,
panic_unwind,