@@ -219,26 +219,18 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
219219 } ;
220220
221221 trace ! ( "Reborrow of size {:?}" , ptr_size) ;
222- let ( alloc_id, base_offset, parent_prov) = match this. ptr_try_get_alloc_id ( place. ptr ( ) , 0 ) {
223- Ok ( data) => {
224- // Unlike SB, we *do* a proper retag for size 0 if can identify the allocation.
225- // After all, the pointer may be lazily initialized outside this initial range.
226- data
227- }
228- Err ( _) => {
229- assert_eq ! ( ptr_size, Size :: ZERO ) ; // we did the deref check above, size has to be 0 here
230- // This pointer doesn't come with an AllocId, so there's no
231- // memory to do retagging in.
232- let new_prov = place. ptr ( ) . provenance ;
233- trace ! (
234- "reborrow of size 0: reusing {:?} (pointee {})" ,
235- place. ptr( ) ,
236- place. layout. ty,
237- ) ;
238- log_creation ( this, None ) ?;
239- // Keep original provenance.
240- return interp_ok ( new_prov) ;
241- }
222+ // Unlike SB, we *do* a proper retag for size 0 if can identify the allocation.
223+ // After all, the pointer may be lazily initialized outside this initial range.
224+ let Ok ( ( alloc_id, base_offset, parent_prov) ) = this. ptr_try_get_alloc_id ( place. ptr ( ) , 0 )
225+ else {
226+ assert_eq ! ( ptr_size, Size :: ZERO ) ; // we did the deref check above, size has to be 0 here
227+ // This pointer doesn't come with an AllocId, so there's no
228+ // memory to do retagging in.
229+ let new_prov = place. ptr ( ) . provenance ;
230+ trace ! ( "reborrow of size 0: reusing {:?} (pointee {})" , place. ptr( ) , place. layout. ty, ) ;
231+ log_creation ( this, None ) ?;
232+ // Keep original provenance.
233+ return interp_ok ( new_prov) ;
242234 } ;
243235 let new_prov = Provenance :: Concrete { alloc_id, tag : new_tag } ;
244236
@@ -607,12 +599,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
607599 name : & str ,
608600 ) -> InterpResult < ' tcx > {
609601 let this = self . eval_context_mut ( ) ;
610- let ( tag, alloc_id) = match ptr. provenance {
611- Some ( Provenance :: Concrete { tag, alloc_id } ) => ( tag, alloc_id) ,
612- _ => {
613- eprintln ! ( "Can't give the name {name} to Wildcard pointer" ) ;
614- return interp_ok ( ( ) ) ;
615- }
602+ let Some ( Provenance :: Concrete { tag, alloc_id } ) = ptr. provenance else {
603+ eprintln ! ( "Can't give the name {name} to wildcard or untagged pointer" ) ;
604+ return interp_ok ( ( ) ) ;
616605 } ;
617606 let alloc_extra = this. get_alloc_extra ( alloc_id) ?;
618607 let mut tree_borrows = alloc_extra. borrow_tracker_tb ( ) . borrow_mut ( ) ;
0 commit comments