File tree Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
157
157
) -> InterpResult < ' tcx , u64 > {
158
158
let ecx = self . eval_context_ref ( ) ;
159
159
let mut rng = ecx. machine . rng . borrow_mut ( ) ;
160
- let ( size, align, kind) = ecx. get_alloc_info ( alloc_id) ;
160
+ let ( size, align, kind, _mutbl ) = ecx. get_alloc_info ( alloc_id) ;
161
161
// This is either called immediately after allocation (and then cached), or when
162
162
// adjusting `tcx` pointers (which never get freed). So assert that we are looking
163
163
// at a live allocation. This also ensures that we never re-assign an address to an
Original file line number Diff line number Diff line change @@ -363,7 +363,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
363
363
// If it does exist, then we have the guarantee that the
364
364
// pointer is readable, and the implicit read access inserted
365
365
// will never cause UB on the pointer itself.
366
- let ( _, _, kind) = this. get_alloc_info ( * alloc_id) ;
366
+ let ( _, _, kind, _mutbl ) = this. get_alloc_info ( * alloc_id) ;
367
367
if matches ! ( kind, AllocKind :: LiveData ) {
368
368
let alloc_extra = this. get_alloc_extra ( * alloc_id) ?; // can still fail for `extern static`
369
369
let alloc_borrow_tracker = & alloc_extra. borrow_tracker . as_ref ( ) . unwrap ( ) ;
Original file line number Diff line number Diff line change @@ -626,7 +626,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
626
626
return interp_ok ( ( ) )
627
627
} ;
628
628
629
- let ( _size, _align, alloc_kind) = this. get_alloc_info ( alloc_id) ;
629
+ let ( _size, _align, alloc_kind, _mutbl ) = this. get_alloc_info ( alloc_id) ;
630
630
match alloc_kind {
631
631
AllocKind :: LiveData => {
632
632
// This should have alloc_extra data, but `get_alloc_extra` can still fail
@@ -1017,7 +1017,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1017
1017
// Function pointers and dead objects don't have an alloc_extra so we ignore them.
1018
1018
// This is okay because accessing them is UB anyway, no need for any Stacked Borrows checks.
1019
1019
// NOT using `get_alloc_extra_mut` since this might be a read-only allocation!
1020
- let ( _size, _align, kind) = this. get_alloc_info ( alloc_id) ;
1020
+ let ( _size, _align, kind, _mutbl ) = this. get_alloc_info ( alloc_id) ;
1021
1021
match kind {
1022
1022
AllocKind :: LiveData => {
1023
1023
// This should have alloc_extra data, but `get_alloc_extra` can still fail
Original file line number Diff line number Diff line change @@ -538,7 +538,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
538
538
// Function pointers and dead objects don't have an alloc_extra so we ignore them.
539
539
// This is okay because accessing them is UB anyway, no need for any Tree Borrows checks.
540
540
// NOT using `get_alloc_extra_mut` since this might be a read-only allocation!
541
- let ( _size, _align, kind) = this. get_alloc_info ( alloc_id) ;
541
+ let ( _size, _align, kind, _mutbl ) = this. get_alloc_info ( alloc_id) ;
542
542
match kind {
543
543
AllocKind :: LiveData => {
544
544
// This should have alloc_extra data, but `get_alloc_extra` can still fail
Original file line number Diff line number Diff line change @@ -1125,7 +1125,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
1125
1125
let Provenance :: Concrete { alloc_id, .. } = ptr. provenance else {
1126
1126
panic ! ( "extern_statics cannot contain wildcards" )
1127
1127
} ;
1128
- let ( shim_size, shim_align, _kind) = ecx. get_alloc_info ( alloc_id) ;
1128
+ let ( shim_size, shim_align, _kind, _mutbl ) = ecx. get_alloc_info ( alloc_id) ;
1129
1129
let def_ty = ecx. tcx . type_of ( def_id) . instantiate_identity ( ) ;
1130
1130
let extern_decl_layout = ecx. tcx . layout_of ( ty:: ParamEnv :: empty ( ) . and ( def_ty) ) . unwrap ( ) ;
1131
1131
if extern_decl_layout. size != shim_size || extern_decl_layout. align . abi != shim_align {
Original file line number Diff line number Diff line change @@ -409,7 +409,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
409
409
) ;
410
410
}
411
411
if let Ok ( ( alloc_id, offset, ..) ) = this. ptr_try_get_alloc_id ( ptr, 0 ) {
412
- let ( _size, alloc_align, _kind) = this. get_alloc_info ( alloc_id) ;
412
+ let ( _size, alloc_align, _kind, _mutbl ) = this. get_alloc_info ( alloc_id) ;
413
413
// If the newly promised alignment is bigger than the native alignment of this
414
414
// allocation, and bigger than the previously promised alignment, then set it.
415
415
if align > alloc_align
You can’t perform that action at this time.
0 commit comments