Skip to content

Commit

Permalink
GetSystemInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 19, 2018
1 parent 50c6f31 commit d0d3870
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/fn_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,23 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a+'mir>: crate::MiriEvalContextExt<'a,
// pretend these do not exist/nothing happened, by returning zero
this.write_null(dest)?;
},
"GetSystemInfo" => {
let system_info = this.deref_operand(args[0])?;
let system_info_ptr = system_info.ptr.to_ptr()?;
// initialize with 0
this.memory_mut().get_mut(system_info_ptr.alloc_id)?
.write_repeat(tcx, system_info_ptr, 0, system_info.layout.size)?;
// set number of processors to 1
let dword_size = Size::from_bytes(4);
let offset = 2*dword_size + 3*tcx.pointer_size();
this.memory_mut().get_mut(system_info_ptr.alloc_id)?
.write_scalar(
tcx,
system_info_ptr.offset(offset, tcx)?,
Scalar::from_int(1, dword_size).into(),
dword_size,
)?;
}

"TlsAlloc" => {
// This just creates a key; Windows does not natively support TLS dtors.
Expand Down

0 comments on commit d0d3870

Please sign in to comment.