Skip to content

Commit 728a45d

Browse files
committed
fix Windows stdout/stderr
1 parent 7614b2a commit 728a45d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fn_call.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,12 +596,12 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
596596
this.write_scalar(Scalar::from_uint(key, dest.layout.size), dest)?;
597597
}
598598
"TlsGetValue" => {
599-
let key = this.read_scalar(args[0])?.to_bits(args[0].layout.size)?;
599+
let key = this.read_scalar(args[0])?.to_usize(this)? as u128;
600600
let ptr = this.machine.tls.load_tls(key)?;
601601
this.write_scalar(ptr, dest)?;
602602
}
603603
"TlsSetValue" => {
604-
let key = this.read_scalar(args[0])?.to_bits(args[0].layout.size)?;
604+
let key = this.read_scalar(args[0])?.to_usize(this)? as u128;
605605
let new_ptr = this.read_scalar(args[1])?.not_undef()?;
606606
this.machine.tls.store_tls(key, new_ptr)?;
607607

@@ -615,7 +615,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
615615
this.write_scalar(handle, dest)?;
616616
}
617617
"WriteFile" => {
618-
let handle = this.read_scalar(args[0])?.to_i32()?;
618+
let handle = this.read_scalar(args[0])?.to_isize(this)?;
619619
let buf = this.read_scalar(args[1])?.not_undef()?;
620620
let n = this.read_scalar(args[2])?.to_usize(&*this.tcx)?;
621621
let written_place = this.deref_operand(args[3])?;

0 commit comments

Comments
 (0)