From 3be3c1f8728411d200dcddd9304233d1d1dd20a0 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 14 Aug 2018 19:00:18 +0200 Subject: [PATCH] WIP windows --- appveyor.yml | 8 ++++---- src/fn_call.rs | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6aee7e75a9..dc05cbb848 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,8 +4,8 @@ environment: matrix: - TARGET: x86_64-pc-windows-msvc MSYS2_BITS: 64 - - TARGET: i686-pc-windows-msvc - MSYS2_BITS: 32 +# - TARGET: i686-pc-windows-msvc +# MSYS2_BITS: 32 # branches to build branches: @@ -26,15 +26,15 @@ install: - cd xargo - set RUSTFLAGS=-Zalways-encode-mir -Zmir-emit-validate=1 - xargo build - - set RUSTFLAGS= - cd .. build: false test_script: + - set RUSTFLAGS=-g - set RUST_BACKTRACE=1 - cargo build --release - - cargo test --release +# - cargo test --release - set MIRI_SYSROOT=C:\Users\appveyor\.xargo\HOST - cargo test --release diff --git a/src/fn_call.rs b/src/fn_call.rs index b475837a6e..345ecccca5 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -646,12 +646,12 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' "TryEnterCriticalSection" => { // pretend these do not exist/nothing happened, by returning zero let ptr_size = self.memory.pointer_size(); - self.write_scalar(dest, Scalar::from_int(0, ptr_size), dest_ty)?; + self.write_scalar(dest, Scalar::from_int(0, dest_layout.size), dest_ty)?; }, "GetLastError" => { // this is c::ERROR_CALL_NOT_IMPLEMENTED let ptr_size = self.memory.pointer_size(); - self.write_scalar(dest, Scalar::from_int(120, ptr_size), dest_ty)?; + self.write_scalar(dest, Scalar::from_int(120, dest_layout.size), dest_ty)?; }, // Windows TLS @@ -665,8 +665,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' if dest_layout.size.bits() < 128 && key >= (1u128 << dest_layout.size.bits() as u128) { return err!(OutOfTls); } - let ptr_size = self.memory.pointer_size(); - self.write_scalar(dest, Scalar::from_uint(key, ptr_size), dest_layout.ty)?; + self.write_scalar(dest, Scalar::from_uint(key, dest_layout.size), dest_layout.ty)?; } "TlsGetValue" => { let key = self.value_to_scalar(args[0])?.to_bytes()?; @@ -677,10 +676,9 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, ' let key = self.value_to_scalar(args[0])?.to_bytes()?; let new_ptr = self.into_ptr(args[1].value)?.unwrap_or_err()?; self.memory.store_tls(key, new_ptr)?; - let ptr_size = self.memory.pointer_size(); // Return success (1) - self.write_scalar(dest, Scalar::from_int(1, ptr_size), dest_ty)?; + self.write_scalar(dest, Scalar::from_int(1, dest_layout.size), dest_ty)?; } // We can't execute anything else