Skip to content

Commit 5fdea5b

Browse files
committed
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.
2 parents 88da675 + 086e9c4 commit 5fdea5b

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

miri

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
33
USAGE=$(cat <<"EOF"
44
COMMANDS

src/diagnostics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::cell::RefCell;
22
use std::fmt;
3+
use std::num::NonZeroU64;
34

45
use log::trace;
56

@@ -41,6 +42,7 @@ impl MachineStopType for TerminationInfo {}
4142

4243
/// Miri specific diagnostics
4344
pub enum NonHaltingDiagnostic {
45+
CreatedPointerTag(NonZeroU64),
4446
PoppedPointerTag(Item),
4547
CreatedCallId(CallId),
4648
CreatedAlloc(AllocId),
@@ -266,6 +268,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
266268
for e in diagnostics.drain(..) {
267269
use NonHaltingDiagnostic::*;
268270
let msg = match e {
271+
CreatedPointerTag(tag) =>
272+
format!("created tag {:?}", tag),
269273
PoppedPointerTag(item) =>
270274
format!("popped tracked tag for item {:?}", item),
271275
CreatedCallId(id) =>

src/stacked_borrows.rs

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ impl GlobalState {
168168

169169
fn new_ptr(&mut self) -> PtrId {
170170
let id = self.next_ptr_id;
171+
if Some(id) == self.tracked_pointer_tag {
172+
register_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(id));
173+
}
171174
self.next_ptr_id = NonZeroU64::new(id.get() + 1).unwrap();
172175
id
173176
}

0 commit comments

Comments
 (0)