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:
bors 2020-10-27 13:29:14 +00:00
commit 5fdea5be99
3 changed files with 8 additions and 1 deletions

2
miri
View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e
USAGE=$(cat <<"EOF"
COMMANDS

View File

@ -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 @@ fn process_diagnostics(&self, info: TopFrameInfo<'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) =>

View File

@ -168,6 +168,9 @@ pub fn new(tracked_pointer_tag: Option<PtrId>, tracked_call_id: Option<CallId>)
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
}