@@ -431,11 +431,13 @@ impl<'mir, 'tcx> MiriEvalContextExt<'mir, 'tcx> for MiriEvalContext<'mir, 'tcx>
431431/// Machine hook implementations.
432432impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for Evaluator < ' mir , ' tcx > {
433433 type MemoryKind = MiriMemoryKind ;
434+ type ExtraFnVal = Dlsym ;
434435
435436 type FrameExtra = FrameData < ' tcx > ;
436437 type AllocExtra = AllocExtra ;
438+
437439 type PointerTag = Tag ;
438- type ExtraFnVal = Dlsym ;
440+ type TagExtra = SbTag ;
439441
440442 type MemoryMap =
441443 MonoHashMap < AllocId , ( MemoryKind < MiriMemoryKind > , Allocation < Tag , Self :: AllocExtra > ) > ;
@@ -607,26 +609,26 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
607609 fn ptr_get_alloc (
608610 ecx : & MiriEvalContext < ' mir , ' tcx > ,
609611 ptr : Pointer < Self :: PointerTag > ,
610- ) -> ( AllocId , Size ) {
612+ ) -> ( AllocId , Size , Self :: TagExtra ) {
611613 let rel = intptrcast:: GlobalStateInner :: abs_ptr_to_rel ( ecx, ptr) ;
612- ( ptr. provenance . alloc_id , rel)
614+ ( ptr. provenance . alloc_id , rel, ptr . provenance . sb )
613615 }
614616
615617 #[ inline( always) ]
616618 fn memory_read (
617619 _tcx : TyCtxt < ' tcx > ,
618620 machine : & Self ,
619621 alloc_extra : & AllocExtra ,
620- tag : Tag ,
622+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
621623 range : AllocRange ,
622624 ) -> InterpResult < ' tcx > {
623625 if let Some ( data_race) = & alloc_extra. data_race {
624- data_race. read ( tag . alloc_id , range, machine. data_race . as_ref ( ) . unwrap ( ) ) ?;
626+ data_race. read ( alloc_id, range, machine. data_race . as_ref ( ) . unwrap ( ) ) ?;
625627 }
626628 if let Some ( stacked_borrows) = & alloc_extra. stacked_borrows {
627629 stacked_borrows. memory_read (
628- tag . alloc_id ,
629- tag. sb ,
630+ alloc_id,
631+ tag,
630632 range,
631633 machine. stacked_borrows . as_ref ( ) . unwrap ( ) ,
632634 )
@@ -640,16 +642,16 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
640642 _tcx : TyCtxt < ' tcx > ,
641643 machine : & mut Self ,
642644 alloc_extra : & mut AllocExtra ,
643- tag : Tag ,
645+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
644646 range : AllocRange ,
645647 ) -> InterpResult < ' tcx > {
646648 if let Some ( data_race) = & mut alloc_extra. data_race {
647- data_race. write ( tag . alloc_id , range, machine. data_race . as_mut ( ) . unwrap ( ) ) ?;
649+ data_race. write ( alloc_id, range, machine. data_race . as_mut ( ) . unwrap ( ) ) ?;
648650 }
649651 if let Some ( stacked_borrows) = & mut alloc_extra. stacked_borrows {
650652 stacked_borrows. memory_written (
651- tag . alloc_id ,
652- tag. sb ,
653+ alloc_id,
654+ tag,
653655 range,
654656 machine. stacked_borrows . as_mut ( ) . unwrap ( ) ,
655657 )
@@ -663,19 +665,19 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
663665 _tcx : TyCtxt < ' tcx > ,
664666 machine : & mut Self ,
665667 alloc_extra : & mut AllocExtra ,
666- tag : Tag ,
668+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
667669 range : AllocRange ,
668670 ) -> InterpResult < ' tcx > {
669- if Some ( tag . alloc_id ) == machine. tracked_alloc_id {
670- register_diagnostic ( NonHaltingDiagnostic :: FreedAlloc ( tag . alloc_id ) ) ;
671+ if Some ( alloc_id) == machine. tracked_alloc_id {
672+ register_diagnostic ( NonHaltingDiagnostic :: FreedAlloc ( alloc_id) ) ;
671673 }
672674 if let Some ( data_race) = & mut alloc_extra. data_race {
673- data_race. deallocate ( tag . alloc_id , range, machine. data_race . as_mut ( ) . unwrap ( ) ) ?;
675+ data_race. deallocate ( alloc_id, range, machine. data_race . as_mut ( ) . unwrap ( ) ) ?;
674676 }
675677 if let Some ( stacked_borrows) = & mut alloc_extra. stacked_borrows {
676678 stacked_borrows. memory_deallocated (
677- tag . alloc_id ,
678- tag. sb ,
679+ alloc_id,
680+ tag,
679681 range,
680682 machine. stacked_borrows . as_mut ( ) . unwrap ( ) ,
681683 )
0 commit comments