@@ -178,11 +178,11 @@ impl GlobalStateInner {
178
178
id
179
179
}
180
180
181
- pub fn new_frame ( & mut self ) -> FrameExtra {
181
+ pub fn new_frame ( & mut self , current_span : & CurrentSpan < ' _ , ' _ , ' _ > ) -> FrameExtra {
182
182
let call_id = self . next_call_id ;
183
183
trace ! ( "new_frame: Assigning call ID {}" , call_id) ;
184
184
if self . tracked_call_ids . contains ( & call_id) {
185
- register_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
185
+ current_span . emit_diagnostic ( NonHaltingDiagnostic :: CreatedCallId ( call_id) ) ;
186
186
}
187
187
self . next_call_id = NonZeroU64 :: new ( call_id. get ( ) + 1 ) . unwrap ( ) ;
188
188
FrameExtra { call_id, protected_tags : SmallVec :: new ( ) }
@@ -199,11 +199,11 @@ impl GlobalStateInner {
199
199
}
200
200
}
201
201
202
- pub fn base_ptr_tag ( & mut self , id : AllocId ) -> SbTag {
202
+ pub fn base_ptr_tag ( & mut self , id : AllocId , current_span : & CurrentSpan < ' _ , ' _ , ' _ > ) -> SbTag {
203
203
self . base_ptr_tags . get ( & id) . copied ( ) . unwrap_or_else ( || {
204
204
let tag = self . new_ptr ( ) ;
205
205
if self . tracked_pointer_tags . contains ( & tag) {
206
- register_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag ( tag. 0 , None ) ) ;
206
+ current_span . emit_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag ( tag. 0 , None ) ) ;
207
207
}
208
208
trace ! ( "New allocation {:?} has base tag {:?}" , id, tag) ;
209
209
self . base_ptr_tags . try_insert ( id, tag) . unwrap ( ) ;
@@ -572,9 +572,9 @@ impl Stacks {
572
572
// not through a pointer). That is, whenever we directly write to a local, this will pop
573
573
// everything else off the stack, invalidating all previous pointers,
574
574
// and in particular, *all* raw pointers.
575
- MemoryKind :: Stack => ( extra. base_ptr_tag ( id) , Permission :: Unique ) ,
575
+ MemoryKind :: Stack => ( extra. base_ptr_tag ( id, & current_span ) , Permission :: Unique ) ,
576
576
// Everything else is shared by default.
577
- _ => ( extra. base_ptr_tag ( id) , Permission :: SharedReadWrite ) ,
577
+ _ => ( extra. base_ptr_tag ( id, & current_span ) , Permission :: SharedReadWrite ) ,
578
578
} ;
579
579
Stacks :: new ( size, perm, base_tag, id, & mut current_span)
580
580
}
@@ -674,7 +674,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriEvalContextEx
674
674
-> InterpResult < ' tcx > {
675
675
let global = this. machine . stacked_borrows . as_ref ( ) . unwrap ( ) . borrow ( ) ;
676
676
if global. tracked_pointer_tags . contains ( & new_tag) {
677
- register_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag (
677
+ this . emit_diagnostic ( NonHaltingDiagnostic :: CreatedPointerTag (
678
678
new_tag. 0 ,
679
679
loc. map ( |( alloc_id, base_offset, _) | ( alloc_id, alloc_range ( base_offset, size) ) ) ,
680
680
) ) ;
0 commit comments