Skip to content

Commit 5c034a5

Browse files
committed
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: rust-lang/rust-project-goals#177.
1 parent b986f17 commit 5c034a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub const MIRI_DEFAULT_ARGS: &[&str] = &[
168168
"-Zmir-emit-retag",
169169
"-Zmir-keep-place-mention",
170170
"-Zmir-opt-level=0",
171-
"-Zmir-enable-passes=-CheckAlignment",
171+
"-Zmir-enable-passes=-CheckAlignment,-CheckNull",
172172
// Deduplicating diagnostics means we miss events when tracking what happens during an
173173
// execution. Let's not do that.
174174
"-Zdeduplicate-diagnostics=no",

0 commit comments

Comments
 (0)