Skip to content

Commit

Permalink
Actually keep PlaceMention if requested.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Apr 21, 2023
1 parent ec3178a commit 0e45fe2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pub const MIRI_DEFAULT_ARGS: &[&str] = &[
"-Zalways-encode-mir",
"-Zextra-const-ub-checks",
"-Zmir-emit-retag",
"-Zmir-keep-place-mention",
"-Zmir-opt-level=0",
"-Zmir-enable-passes=-CheckAlignment",
];
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ fn main() {
let b = Box::new(42);
&*b as *const i32
};
let _ = unsafe { *p }; //~ ERROR: dereferenced after this allocation got freed
unsafe {
let _ = *p; //~ ERROR: dereferenced after this allocation got freed
}
panic!("this should never print");
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: Undefined Behavior: pointer to ALLOC was dereferenced after this allocation got freed
--> $DIR/dangling_pointer_deref_underscore.rs:LL:CC
|
LL | let _ = unsafe { *p };
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
LL | let _ = *p;
| ^^ pointer to ALLOC was dereferenced after this allocation got freed
|
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
Expand Down

0 comments on commit 0e45fe2

Please sign in to comment.