Skip to content

Commit 3be3c1f

Browse files
committed
WIP windows
1 parent 7c73df9 commit 3be3c1f

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

appveyor.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ environment:
44
matrix:
55
- TARGET: x86_64-pc-windows-msvc
66
MSYS2_BITS: 64
7-
- TARGET: i686-pc-windows-msvc
8-
MSYS2_BITS: 32
7+
# - TARGET: i686-pc-windows-msvc
8+
# MSYS2_BITS: 32
99

1010
# branches to build
1111
branches:
@@ -26,15 +26,15 @@ install:
2626
- cd xargo
2727
- set RUSTFLAGS=-Zalways-encode-mir -Zmir-emit-validate=1
2828
- xargo build
29-
- set RUSTFLAGS=
3029
- cd ..
3130

3231
build: false
3332

3433
test_script:
34+
- set RUSTFLAGS=-g
3535
- set RUST_BACKTRACE=1
3636
- cargo build --release
37-
- cargo test --release
37+
# - cargo test --release
3838
- set MIRI_SYSROOT=C:\Users\appveyor\.xargo\HOST
3939
- cargo test --release
4040

src/fn_call.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -646,12 +646,12 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
646646
"TryEnterCriticalSection" => {
647647
// pretend these do not exist/nothing happened, by returning zero
648648
let ptr_size = self.memory.pointer_size();
649-
self.write_scalar(dest, Scalar::from_int(0, ptr_size), dest_ty)?;
649+
self.write_scalar(dest, Scalar::from_int(0, dest_layout.size), dest_ty)?;
650650
},
651651
"GetLastError" => {
652652
// this is c::ERROR_CALL_NOT_IMPLEMENTED
653653
let ptr_size = self.memory.pointer_size();
654-
self.write_scalar(dest, Scalar::from_int(120, ptr_size), dest_ty)?;
654+
self.write_scalar(dest, Scalar::from_int(120, dest_layout.size), dest_ty)?;
655655
},
656656

657657
// Windows TLS
@@ -665,8 +665,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
665665
if dest_layout.size.bits() < 128 && key >= (1u128 << dest_layout.size.bits() as u128) {
666666
return err!(OutOfTls);
667667
}
668-
let ptr_size = self.memory.pointer_size();
669-
self.write_scalar(dest, Scalar::from_uint(key, ptr_size), dest_layout.ty)?;
668+
self.write_scalar(dest, Scalar::from_uint(key, dest_layout.size), dest_layout.ty)?;
670669
}
671670
"TlsGetValue" => {
672671
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, '
677676
let key = self.value_to_scalar(args[0])?.to_bytes()?;
678677
let new_ptr = self.into_ptr(args[1].value)?.unwrap_or_err()?;
679678
self.memory.store_tls(key, new_ptr)?;
680-
let ptr_size = self.memory.pointer_size();
681679

682680
// Return success (1)
683-
self.write_scalar(dest, Scalar::from_int(1, ptr_size), dest_ty)?;
681+
self.write_scalar(dest, Scalar::from_int(1, dest_layout.size), dest_ty)?;
684682
}
685683

686684
// We can't execute anything else

0 commit comments

Comments
 (0)