@@ -220,26 +220,18 @@ trait EvalContextPrivExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
220220 } ;
221221
222222 trace ! ( "Reborrow of size {:?}" , ptr_size) ;
223- let ( alloc_id, base_offset, parent_prov) = match this. ptr_try_get_alloc_id ( place. ptr ( ) , 0 ) {
224- Ok ( data) => {
225- // Unlike SB, we *do* a proper retag for size 0 if can identify the allocation.
226- // After all, the pointer may be lazily initialized outside this initial range.
227- data
228- }
229- Err ( _) => {
230- assert_eq ! ( ptr_size, Size :: ZERO ) ; // we did the deref check above, size has to be 0 here
231- // This pointer doesn't come with an AllocId, so there's no
232- // memory to do retagging in.
233- let new_prov = place. ptr ( ) . provenance ;
234- trace ! (
235- "reborrow of size 0: reusing {:?} (pointee {})" ,
236- place. ptr( ) ,
237- place. layout. ty,
238- ) ;
239- log_creation ( this, None ) ?;
240- // Keep original provenance.
241- return interp_ok ( new_prov) ;
242- }
223+ // Unlike SB, we *do* a proper retag for size 0 if can identify the allocation.
224+ // After all, the pointer may be lazily initialized outside this initial range.
225+ let Ok ( ( alloc_id, base_offset, parent_prov) ) = this. ptr_try_get_alloc_id ( place. ptr ( ) , 0 )
226+ else {
227+ assert_eq ! ( ptr_size, Size :: ZERO ) ; // we did the deref check above, size has to be 0 here
228+ // This pointer doesn't come with an AllocId, so there's no
229+ // memory to do retagging in.
230+ let new_prov = place. ptr ( ) . provenance ;
231+ trace ! ( "reborrow of size 0: reusing {:?} (pointee {})" , place. ptr( ) , place. layout. ty, ) ;
232+ log_creation ( this, None ) ?;
233+ // Keep original provenance.
234+ return interp_ok ( new_prov) ;
243235 } ;
244236 let new_prov = Provenance :: Concrete { alloc_id, tag : new_tag } ;
245237
@@ -612,8 +604,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
612604 let this = self . eval_context_mut ( ) ;
613605 let ( tag, alloc_id) = match ptr. provenance {
614606 Some ( Provenance :: Concrete { tag, alloc_id } ) => ( tag, alloc_id) ,
615- _ => {
616- eprintln ! ( "Can't give the name {name} to Wildcard pointer" ) ;
607+ Some ( Provenance :: Wildcard ) => {
608+ eprintln ! ( "Can't give the name {name} to wildcard pointer" ) ;
609+ return interp_ok ( ( ) ) ;
610+ }
611+ None => {
612+ eprintln ! ( "Can't give the name {name} to pointer without provenance" ) ;
617613 return interp_ok ( ( ) ) ;
618614 }
619615 } ;
0 commit comments