Skip to content

Commit 7bdd23a

Browse files
committed
Auto merge of #143888 - matthiaskrgr:rollup-fv9x7kf, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang/rust#143301 (`tests/ui`: A New Order [26/N]) - rust-lang/rust#143519 (Check assoc consts and tys later like assoc fns) - rust-lang/rust#143554 (slice: Mark `rotate_left`, `rotate_right` unstably const) - rust-lang/rust#143634 (interpret/allocation: expose init + write_wildcards on a range) - rust-lang/rust#143685 (Resolve: merge `source_bindings` and `target_bindings` into `bindings`) - rust-lang/rust#143734 (Refactor resolve resolution bindings) - rust-lang/rust#143774 (constify `From` and `Into`) - rust-lang/rust#143785 (Add --compile-time-deps argument for x check) - rust-lang/rust#143786 (Fix fallback for CI_JOB_NAME) - rust-lang/rust#143825 (clippy: fix test filtering when TESTNAME is empty) - rust-lang/rust#143826 (Fix command trace) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b2fe1f3 + f5ff436 commit 7bdd23a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/shims/native_lib/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
231231
.collect::<Vec<libffi::high::Arg<'_>>>();
232232

233233
// Prepare all exposed memory (both previously exposed, and just newly exposed since a
234-
// pointer was passed as argument).
234+
// pointer was passed as argument). Uninitialised memory is left as-is, but any data
235+
// exposed this way is garbage anyway.
235236
this.visit_reachable_allocs(this.exposed_allocs(), |this, alloc_id, info| {
236237
// If there is no data behind this pointer, skip this.
237238
if !matches!(info.kind, AllocKind::LiveData) {
@@ -251,8 +252,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
251252

252253
// Prepare for possible write from native code if mutable.
253254
if info.mutbl.is_mut() {
254-
let alloc = &mut this.get_alloc_raw_mut(alloc_id)?.0;
255-
alloc.prepare_for_native_access();
255+
let (alloc, cx) = this.get_alloc_raw_mut(alloc_id)?;
256+
alloc.process_native_write(&cx.tcx, None);
256257
// Also expose *mutable* provenance for the interpreter-level allocation.
257258
std::hint::black_box(alloc.get_bytes_unchecked_raw_mut().expose_provenance());
258259
}

0 commit comments

Comments
 (0)