Auto merge of #1601 - RalfJung:misc, r=RalfJung
pointer tag tracking: also show when tag is being created Also use bash to make sure `&>` works.
This commit is contained in:
commit
5fdea5be99
3 changed files with 8 additions and 1 deletions
2
miri
2
miri
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
USAGE=$(cat <<"EOF"
|
||||
COMMANDS
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use std::cell::RefCell;
|
||||
use std::fmt;
|
||||
use std::num::NonZeroU64;
|
||||
|
||||
use log::trace;
|
||||
|
||||
|
|
@ -41,6 +42,7 @@ impl MachineStopType for TerminationInfo {}
|
|||
|
||||
/// Miri specific diagnostics
|
||||
pub enum NonHaltingDiagnostic {
|
||||
CreatedPointerTag(NonZeroU64),
|
||||
PoppedPointerTag(Item),
|
||||
CreatedCallId(CallId),
|
||||
CreatedAlloc(AllocId),
|
||||
|
|
@ -266,6 +268,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
for e in diagnostics.drain(..) {
|
||||
use NonHaltingDiagnostic::*;
|
||||
let msg = match e {
|
||||
CreatedPointerTag(tag) =>
|
||||
format!("created tag {:?}", tag),
|
||||
PoppedPointerTag(item) =>
|
||||
format!("popped tracked tag for item {:?}", item),
|
||||
CreatedCallId(id) =>
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@ impl GlobalState {
|
|||
|
||||
fn new_ptr(&mut self) -> PtrId {
|
||||
let id = self.next_ptr_id;
|
||||
if Some(id) == self.tracked_pointer_tag {
|
||||
register_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(id));
|
||||
}
|
||||
self.next_ptr_id = NonZeroU64::new(id.get() + 1).unwrap();
|
||||
id
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue