Skip to content

Commit 7caec1b

Browse files
committed
basic support for AllocKind::VaList in miri
1 parent b5aa67c commit 7caec1b

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

  • src/tools/miri/src

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
185185
#[cfg(not(all(unix, feature = "native-lib")))]
186186
AllocKind::Function => dummy_alloc(params),
187187
AllocKind::VTable => dummy_alloc(params),
188-
AllocKind::TypeId | AllocKind::Dead => unreachable!(),
188+
AllocKind::TypeId | AllocKind::Dead | AllocKind::VaList => unreachable!(),
189189
};
190190
// We don't have to expose this pointer yet, we do that in `prepare_for_native_call`.
191191
return interp_ok(base_ptr.addr().to_u64());
@@ -363,8 +363,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
363363
ProvenanceMode::Default => {
364364
// The first time this happens at a particular location, print a warning.
365365
static DEDUP: SpanDedupDiagnostic = SpanDedupDiagnostic::new();
366-
this.dedup_diagnostic(&DEDUP, |first| {
367-
NonHaltingDiagnostic::Int2Ptr { details: first }
366+
this.dedup_diagnostic(&DEDUP, |first| NonHaltingDiagnostic::Int2Ptr {
367+
details: first,
368368
});
369369
}
370370
ProvenanceMode::Strict => {

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)