From 1cfd80ea2d35ed0b7463c6e1e29a602c2a366db5 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 30 Mar 2020 22:13:53 +0200 Subject: [PATCH] rustup; fix Windows env var memory type --- rust-version | 2 +- src/shims/env.rs | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/rust-version b/rust-version index 4f4cff76583b..a812b46de17f 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -8926bb497d9b127eb318aea5aed0e745d8381591 +9a12971da5c08f9a95d54bdaef5cd83698ed4509 diff --git a/src/shims/env.rs b/src/shims/env.rs index 76d1de5d9a64..d30e953cf56a 100644 --- a/src/shims/env.rs +++ b/src/shims/env.rs @@ -165,8 +165,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx } // Allocate environment block & Store environment variables to environment block. // Final null terminator(block terminator) is added by `alloc_os_str_to_wide_str`. - // FIXME: MemoryKind should be `Env`, blocked on https://github.com/rust-lang/rust/pull/70479. - let envblock_ptr = this.alloc_os_str_as_wide_str(&env_vars, MiriMemoryKind::WinHeap.into()); + let envblock_ptr = this.alloc_os_str_as_wide_str(&env_vars, MiriMemoryKind::Env.into()); // If the function succeeds, the return value is a pointer to the environment block of the current process. Ok(envblock_ptr.into()) } @@ -177,8 +176,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx this.assert_target_os("windows", "FreeEnvironmentStringsW"); let env_block_ptr = this.read_scalar(env_block_op)?.not_undef()?; - // FIXME: MemoryKind should be `Env`, blocked on https://github.com/rust-lang/rust/pull/70479. - let result = this.memory.deallocate(this.force_ptr(env_block_ptr)?, None, MiriMemoryKind::WinHeap.into()); + let result = this.memory.deallocate(this.force_ptr(env_block_ptr)?, None, MiriMemoryKind::Env.into()); // If the function succeeds, the return value is nonzero. Ok(result.is_ok() as i32) }