@@ -327,20 +327,21 @@ impl<'tcx> Stack {
327
327
/// `None` during a deallocation.
328
328
fn check_protector (
329
329
item : & Item ,
330
- provoking_access : Option < ( SbTag , AllocId , AllocRange , Size ) > , // just for debug printing and error messages
330
+ provoking_access : Option < ( SbTag , AllocId , AllocRange , Size , AccessKind ) > , // just for debug printing and error messages
331
331
global : & GlobalStateInner ,
332
332
) -> InterpResult < ' tcx > {
333
333
if let SbTag :: Tagged ( id) = item. tag {
334
334
if global. tracked_pointer_tags . contains ( & id) {
335
335
register_diagnostic ( NonHaltingDiagnostic :: PoppedPointerTag (
336
336
* item,
337
- None ,
337
+ provoking_access
338
+ . map ( |( tag, _alloc_id, _alloc_range, _size, access) | ( tag, access) ) ,
338
339
) ) ;
339
340
}
340
341
}
341
342
if let Some ( call) = item. protector {
342
343
if global. is_active ( call) {
343
- if let Some ( ( tag, alloc_id, alloc_range, offset) ) = provoking_access {
344
+ if let Some ( ( tag, alloc_id, alloc_range, offset, _access ) ) = provoking_access {
344
345
Err ( err_sb_ub (
345
346
format ! (
346
347
"not granting access to tag {:?} because incompatible item is protected: {:?}" ,
@@ -393,7 +394,11 @@ impl<'tcx> Stack {
393
394
let first_incompatible_idx = self . find_first_write_incompatible ( granting_idx) ;
394
395
for item in self . borrows . drain ( first_incompatible_idx..) . rev ( ) {
395
396
trace ! ( "access: popping item {:?}" , item) ;
396
- Stack :: check_protector ( & item, Some ( ( tag, alloc_id, alloc_range, offset) ) , global) ?;
397
+ Stack :: check_protector (
398
+ & item,
399
+ Some ( ( tag, alloc_id, alloc_range, offset, access) ) ,
400
+ global,
401
+ ) ?;
397
402
global. add_invalidation ( item. tag , alloc_id, alloc_range) ;
398
403
}
399
404
} else {
@@ -411,7 +416,7 @@ impl<'tcx> Stack {
411
416
trace ! ( "access: disabling item {:?}" , item) ;
412
417
Stack :: check_protector (
413
418
item,
414
- Some ( ( tag, alloc_id, alloc_range, offset) ) ,
419
+ Some ( ( tag, alloc_id, alloc_range, offset, access ) ) ,
415
420
global,
416
421
) ?;
417
422
item. perm = Permission :: Disabled ;
0 commit comments