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:
parent
851322b74d
commit
b151b513ba
32 changed files with 281 additions and 6 deletions
|
@ -17,6 +17,9 @@ middle_assert_gen_resume_after_panic = `gen` fn or block cannot be further itera
|
|||
middle_assert_misaligned_ptr_deref =
|
||||
misaligned pointer dereference: address must be a multiple of {$required} but is {$found}
|
||||
|
||||
middle_assert_null_ptr_deref =
|
||||
null pointer dereference occurred
|
||||
|
||||
middle_assert_op_overflow =
|
||||
attempt to compute `{$left} {$op} {$right}`, which would overflow
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue