@@ -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
@@ -609,8 +601,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
609601 let this = self . eval_context_mut ( ) ;
610602 let ( tag, alloc_id) = match ptr. provenance {
611603 Some ( Provenance :: Concrete { tag, alloc_id } ) => ( tag, alloc_id) ,
612- _ => {
613- eprintln ! ( "Can't give the name {name} to Wildcard pointer" ) ;
604+ Some ( Provenance :: Wildcard ) => {
605+ eprintln ! ( "Can't give the name {name} to wildcard pointer" ) ;
606+ return interp_ok ( ( ) ) ;
607+ }
608+ None => {
609+ eprintln ! ( "Can't give the name {name} to pointer without provenance" ) ;
614610 return interp_ok ( ( ) ) ;
615611 }
616612 } ;
0 commit comments