mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
weak memory outdated loads: show where the load was from
This commit is contained in:
parent
9d7a47fe31
commit
f38dba69b1
@ -520,7 +520,9 @@ pub(super) trait EvalContextExt<'mir, 'tcx: 'mir>:
|
||||
validate,
|
||||
)?;
|
||||
if global.track_outdated_loads && recency == LoadRecency::Outdated {
|
||||
this.emit_diagnostic(NonHaltingDiagnostic::WeakMemoryOutdatedLoad);
|
||||
this.emit_diagnostic(NonHaltingDiagnostic::WeakMemoryOutdatedLoad {
|
||||
ptr: place.ptr(),
|
||||
});
|
||||
}
|
||||
|
||||
return Ok(loaded);
|
||||
|
@ -125,7 +125,9 @@ pub enum NonHaltingDiagnostic {
|
||||
Int2Ptr {
|
||||
details: bool,
|
||||
},
|
||||
WeakMemoryOutdatedLoad,
|
||||
WeakMemoryOutdatedLoad {
|
||||
ptr: Pointer<Option<Provenance>>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Level of Miri specific diagnostics
|
||||
@ -583,7 +585,8 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
|
||||
| AccessedAlloc(..)
|
||||
| FreedAlloc(..)
|
||||
| ProgressReport { .. }
|
||||
| WeakMemoryOutdatedLoad => ("tracking was triggered".to_string(), DiagLevel::Note),
|
||||
| WeakMemoryOutdatedLoad { .. } =>
|
||||
("tracking was triggered".to_string(), DiagLevel::Note),
|
||||
};
|
||||
|
||||
let msg = match &e {
|
||||
@ -610,8 +613,8 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
|
||||
ProgressReport { .. } =>
|
||||
format!("progress report: current operation being executed is here"),
|
||||
Int2Ptr { .. } => format!("integer-to-pointer cast"),
|
||||
WeakMemoryOutdatedLoad =>
|
||||
format!("weak memory emulation: outdated value returned from load"),
|
||||
WeakMemoryOutdatedLoad { ptr } =>
|
||||
format!("weak memory emulation: outdated value returned from load at {ptr}"),
|
||||
};
|
||||
|
||||
let notes = match &e {
|
||||
|
Loading…
Reference in New Issue
Block a user