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
2
miri
2
miri
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
USAGE=$(cat <<"EOF"
|
USAGE=$(cat <<"EOF"
|
||||||
COMMANDS
|
COMMANDS
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
use std::num::NonZeroU64;
|
||||||
|
|
||||||
use log::trace;
|
use log::trace;
|
||||||
|
|
||||||
@ -41,6 +42,7 @@ impl MachineStopType for TerminationInfo {}
|
|||||||
|
|
||||||
/// Miri specific diagnostics
|
/// Miri specific diagnostics
|
||||||
pub enum NonHaltingDiagnostic {
|
pub enum NonHaltingDiagnostic {
|
||||||
|
CreatedPointerTag(NonZeroU64),
|
||||||
PoppedPointerTag(Item),
|
PoppedPointerTag(Item),
|
||||||
CreatedCallId(CallId),
|
CreatedCallId(CallId),
|
||||||
CreatedAlloc(AllocId),
|
CreatedAlloc(AllocId),
|
||||||
@ -266,6 +268,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||||||
for e in diagnostics.drain(..) {
|
for e in diagnostics.drain(..) {
|
||||||
use NonHaltingDiagnostic::*;
|
use NonHaltingDiagnostic::*;
|
||||||
let msg = match e {
|
let msg = match e {
|
||||||
|
CreatedPointerTag(tag) =>
|
||||||
|
format!("created tag {:?}", tag),
|
||||||
PoppedPointerTag(item) =>
|
PoppedPointerTag(item) =>
|
||||||
format!("popped tracked tag for item {:?}", item),
|
format!("popped tracked tag for item {:?}", item),
|
||||||
CreatedCallId(id) =>
|
CreatedCallId(id) =>
|
||||||
|
@ -168,6 +168,9 @@ impl GlobalState {
|
|||||||
|
|
||||||
fn new_ptr(&mut self) -> PtrId {
|
fn new_ptr(&mut self) -> PtrId {
|
||||||
let id = self.next_ptr_id;
|
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();
|
self.next_ptr_id = NonZeroU64::new(id.get() + 1).unwrap();
|
||||||
id
|
id
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user