Skip to content

Commit 7b44318

Browse files
committed
basic support for AllocKind::VaList in miri
1 parent 0f97b9e commit 7b44318

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

  • src/tools/miri/src

src/tools/miri/src/alloc_addresses/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
174174
std::mem::forget(alloc_bytes);
175175
ptr
176176
}
177-
AllocKind::TypeId | AllocKind::Dead => unreachable!(),
177+
AllocKind::TypeId | AllocKind::Dead | AllocKind::VaList => unreachable!(),
178178
};
179179
// We don't have to expose this pointer yet, we do that in `prepare_for_native_call`.
180180
return interp_ok(base_ptr.addr().to_u64());

src/tools/miri/src/borrow_tracker/stacked_borrows/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ trait EvalContextPrivExt<'tcx, 'ecx>: crate::MiriInterpCxExt<'tcx> {
651651
dcx.log_protector();
652652
}
653653
},
654-
AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => {
654+
AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead | AllocKind::VaList => {
655655
// No stacked borrows on these allocations.
656656
}
657657
}
@@ -1010,7 +1010,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
10101010
trace!("Stacked Borrows tag {tag:?} exposed in {alloc_id:?}");
10111011
alloc_extra.borrow_tracker_sb().borrow_mut().exposed_tags.insert(tag);
10121012
}
1013-
AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => {
1013+
AllocKind::Function
1014+
| AllocKind::VTable
1015+
| AllocKind::TypeId
1016+
| AllocKind::Dead
1017+
| AllocKind::VaList => {
10141018
// No stacked borrows on these allocations.
10151019
}
10161020
}

src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
576576
let protected = protected_tags.contains_key(&tag);
577577
alloc_extra.borrow_tracker_tb().borrow_mut().expose_tag(tag, protected);
578578
}
579-
AllocKind::Function | AllocKind::VTable | AllocKind::TypeId | AllocKind::Dead => {
579+
AllocKind::Function
580+
| AllocKind::VTable
581+
| AllocKind::TypeId
582+
| AllocKind::Dead
583+
| AllocKind::VaList => {
580584
// No tree borrows on these allocations.
581585
}
582586
}

0 commit comments

Comments
 (0)