Skip to content

Commit 17f7bc8

Browse files
author
Vytautas Astrauskas
committed
Fix how a pthread_create function argument is constructed.
1 parent 80459bb commit 17f7bc8

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/shims/thread.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3737
let fn_ptr = this.read_scalar(start_routine)?.not_undef()?;
3838
let instance = this.memory.get_fn(fn_ptr)?.as_instance()?;
3939

40-
let func_arg = match *arg {
41-
rustc_mir::interpret::Operand::Immediate(immediate) => immediate,
42-
_ => unreachable!(),
43-
};
44-
let func_args = [func_arg];
40+
let func_arg = this.read_immediate(arg)?;
41+
let func_args = [*func_arg];
4542

4643
let ret_place =
4744
this.allocate(this.layout_of(this.tcx.types.usize)?, MiriMemoryKind::Machine.into());

0 commit comments

Comments
 (0)