@@ -431,11 +431,13 @@ impl<'mir, 'tcx> MiriEvalContextExt<'mir, 'tcx> for MiriEvalContext<'mir, 'tcx>
431
431
/// Machine hook implementations.
432
432
impl < ' mir , ' tcx > Machine < ' mir , ' tcx > for Evaluator < ' mir , ' tcx > {
433
433
type MemoryKind = MiriMemoryKind ;
434
+ type ExtraFnVal = Dlsym ;
434
435
435
436
type FrameExtra = FrameData < ' tcx > ;
436
437
type AllocExtra = AllocExtra ;
438
+
437
439
type PointerTag = Tag ;
438
- type ExtraFnVal = Dlsym ;
440
+ type TagExtra = SbTag ;
439
441
440
442
type MemoryMap =
441
443
MonoHashMap < AllocId , ( MemoryKind < MiriMemoryKind > , Allocation < Tag , Self :: AllocExtra > ) > ;
@@ -607,26 +609,26 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
607
609
fn ptr_get_alloc (
608
610
ecx : & MiriEvalContext < ' mir , ' tcx > ,
609
611
ptr : Pointer < Self :: PointerTag > ,
610
- ) -> ( AllocId , Size ) {
612
+ ) -> ( AllocId , Size , Self :: TagExtra ) {
611
613
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 )
613
615
}
614
616
615
617
#[ inline( always) ]
616
618
fn memory_read (
617
619
_tcx : TyCtxt < ' tcx > ,
618
620
machine : & Self ,
619
621
alloc_extra : & AllocExtra ,
620
- tag : Tag ,
622
+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
621
623
range : AllocRange ,
622
624
) -> InterpResult < ' tcx > {
623
625
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 ( ) ) ?;
625
627
}
626
628
if let Some ( stacked_borrows) = & alloc_extra. stacked_borrows {
627
629
stacked_borrows. memory_read (
628
- tag . alloc_id ,
629
- tag. sb ,
630
+ alloc_id,
631
+ tag,
630
632
range,
631
633
machine. stacked_borrows . as_ref ( ) . unwrap ( ) ,
632
634
)
@@ -640,16 +642,16 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
640
642
_tcx : TyCtxt < ' tcx > ,
641
643
machine : & mut Self ,
642
644
alloc_extra : & mut AllocExtra ,
643
- tag : Tag ,
645
+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
644
646
range : AllocRange ,
645
647
) -> InterpResult < ' tcx > {
646
648
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 ( ) ) ?;
648
650
}
649
651
if let Some ( stacked_borrows) = & mut alloc_extra. stacked_borrows {
650
652
stacked_borrows. memory_written (
651
- tag . alloc_id ,
652
- tag. sb ,
653
+ alloc_id,
654
+ tag,
653
655
range,
654
656
machine. stacked_borrows . as_mut ( ) . unwrap ( ) ,
655
657
)
@@ -663,19 +665,19 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
663
665
_tcx : TyCtxt < ' tcx > ,
664
666
machine : & mut Self ,
665
667
alloc_extra : & mut AllocExtra ,
666
- tag : Tag ,
668
+ ( alloc_id , tag) : ( AllocId , Self :: TagExtra ) ,
667
669
range : AllocRange ,
668
670
) -> 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) ) ;
671
673
}
672
674
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 ( ) ) ?;
674
676
}
675
677
if let Some ( stacked_borrows) = & mut alloc_extra. stacked_borrows {
676
678
stacked_borrows. memory_deallocated (
677
- tag . alloc_id ,
678
- tag. sb ,
679
+ alloc_id,
680
+ tag,
679
681
range,
680
682
machine. stacked_borrows . as_mut ( ) . unwrap ( ) ,
681
683
)
0 commit comments