Skip to content

Commit 0ed2a3b

Browse files
authored
Merge pull request #4467 from rust-lang/rustup-2025-07-14
Automatic Rustup
2 parents 861fb3b + b555b65 commit 0ed2a3b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
32cd9114712a24010b0583624dc52ac302194128
1+
9c3064e131f4939cc95a29bb11413c49bbda1491

src/shims/native_lib/mod.rs

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

257257
// Prepare all exposed memory (both previously exposed, and just newly exposed since a
258-
// pointer was passed as argument).
258+
// pointer was passed as argument). Uninitialised memory is left as-is, but any data
259+
// exposed this way is garbage anyway.
259260
this.visit_reachable_allocs(this.exposed_allocs(), |this, alloc_id, info| {
260261
// If there is no data behind this pointer, skip this.
261262
if !matches!(info.kind, AllocKind::LiveData) {
@@ -275,8 +276,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
275276

276277
// Prepare for possible write from native code if mutable.
277278
if info.mutbl.is_mut() {
278-
let alloc = &mut this.get_alloc_raw_mut(alloc_id)?.0;
279-
alloc.prepare_for_native_access();
279+
let (alloc, cx) = this.get_alloc_raw_mut(alloc_id)?;
280+
alloc.process_native_write(&cx.tcx, None);
280281
// Also expose *mutable* provenance for the interpreter-level allocation.
281282
std::hint::black_box(alloc.get_bytes_unchecked_raw_mut().expose_provenance());
282283
}

tests/ui.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ fn miri_config(
9797
let mut config = Config {
9898
target: Some(target.to_owned()),
9999
program,
100+
// When changing this, remember to also adjust the logic in bootstrap, in Miri's test step,
101+
// that deletes the `miri_ui` dir when it needs a rebuild.
100102
out_dir: PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join("miri_ui"),
101103
threads: std::env::var("MIRI_TEST_THREADS")
102104
.ok()

0 commit comments

Comments
 (0)