Skip to content

Commit 1cfd80e

Browse files
committed
rustup; fix Windows env var memory type
1 parent 45b6891 commit 1cfd80e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8926bb497d9b127eb318aea5aed0e745d8381591
1+
9a12971da5c08f9a95d54bdaef5cd83698ed4509

src/shims/env.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
165165
}
166166
// Allocate environment block & Store environment variables to environment block.
167167
// Final null terminator(block terminator) is added by `alloc_os_str_to_wide_str`.
168-
// FIXME: MemoryKind should be `Env`, blocked on https://github.com/rust-lang/rust/pull/70479.
169-
let envblock_ptr = this.alloc_os_str_as_wide_str(&env_vars, MiriMemoryKind::WinHeap.into());
168+
let envblock_ptr = this.alloc_os_str_as_wide_str(&env_vars, MiriMemoryKind::Env.into());
170169
// If the function succeeds, the return value is a pointer to the environment block of the current process.
171170
Ok(envblock_ptr.into())
172171
}
@@ -177,8 +176,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
177176
this.assert_target_os("windows", "FreeEnvironmentStringsW");
178177

179178
let env_block_ptr = this.read_scalar(env_block_op)?.not_undef()?;
180-
// FIXME: MemoryKind should be `Env`, blocked on https://github.com/rust-lang/rust/pull/70479.
181-
let result = this.memory.deallocate(this.force_ptr(env_block_ptr)?, None, MiriMemoryKind::WinHeap.into());
179+
let result = this.memory.deallocate(this.force_ptr(env_block_ptr)?, None, MiriMemoryKind::Env.into());
182180
// If the function succeeds, the return value is nonzero.
183181
Ok(result.is_ok() as i32)
184182
}

0 commit comments

Comments
 (0)