Fix how a pthread_create function argument is constructed.

This commit is contained in:
Vytautas Astrauskas 2020-04-19 15:23:30 -07:00
parent 80459bbf77
commit 17f7bc86ae

View File

@ -37,11 +37,8 @@ fn pthread_create(
let fn_ptr = this.read_scalar(start_routine)?.not_undef()?;
let instance = this.memory.get_fn(fn_ptr)?.as_instance()?;
let func_arg = match *arg {
rustc_mir::interpret::Operand::Immediate(immediate) => immediate,
_ => unreachable!(),
};
let func_args = [func_arg];
let func_arg = this.read_immediate(arg)?;
let func_args = [*func_arg];
let ret_place =
this.allocate(this.layout_of(this.tcx.types.usize)?, MiriMemoryKind::Machine.into());