Fix compilation errors after rebase.
This commit is contained in:
parent
90590a399d
commit
dec205757a
@ -331,42 +331,52 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_condattr_init" => {
|
||||
let result = this.pthread_condattr_init(args[0])?;
|
||||
let &[attr] = check_arg_count(args)?;
|
||||
let result = this.pthread_condattr_init(attr)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_condattr_setclock" => {
|
||||
let result = this.pthread_condattr_setclock(args[0], args[1])?;
|
||||
let &[attr, clock_id] = check_arg_count(args)?;
|
||||
let result = this.pthread_condattr_setclock(attr, clock_id)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_condattr_getclock" => {
|
||||
let result = this.pthread_condattr_getclock(args[0], args[1])?;
|
||||
let &[attr, clock_id] = check_arg_count(args)?;
|
||||
let result = this.pthread_condattr_getclock(attr, clock_id)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_condattr_destroy" => {
|
||||
let result = this.pthread_condattr_destroy(args[0])?;
|
||||
let &[attr] = check_arg_count(args)?;
|
||||
let result = this.pthread_condattr_destroy(attr)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_cond_init" => {
|
||||
let result = this.pthread_cond_init(args[0], args[1])?;
|
||||
let &[cond, attr] = check_arg_count(args)?;
|
||||
let result = this.pthread_cond_init(cond, attr)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_cond_signal" => {
|
||||
let result = this.pthread_cond_signal(args[0])?;
|
||||
let &[cond] = check_arg_count(args)?;
|
||||
let result = this.pthread_cond_signal(cond)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_cond_broadcast" => {
|
||||
let result = this.pthread_cond_broadcast(args[0])?;
|
||||
let &[cond] = check_arg_count(args)?;
|
||||
let result = this.pthread_cond_broadcast(cond)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_cond_wait" => {
|
||||
let result = this.pthread_cond_wait(args[0], args[1])?;
|
||||
let &[cond, mutex] = check_arg_count(args)?;
|
||||
let result = this.pthread_cond_wait(cond, mutex)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
"pthread_cond_timedwait" => {
|
||||
this.pthread_cond_timedwait(args[0], args[1], args[2], dest)?;
|
||||
let &[cond, mutex, abstime] = check_arg_count(args)?;
|
||||
this.pthread_cond_timedwait(cond, mutex, abstime, dest)?;
|
||||
}
|
||||
"pthread_cond_destroy" => {
|
||||
let result = this.pthread_cond_destroy(args[0])?;
|
||||
let &[cond] = check_arg_count(args)?;
|
||||
let result = this.pthread_cond_destroy(cond)?;
|
||||
this.write_scalar(Scalar::from_i32(result), dest)?;
|
||||
}
|
||||
|
||||
@ -430,6 +440,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
|
||||
| "pthread_attr_init"
|
||||
| "pthread_attr_destroy"
|
||||
if this.frame().instance.to_string().starts_with("std::sys::unix::") => {
|
||||
let &[_] = check_arg_count(args)?;
|
||||
this.write_null(dest)?;
|
||||
}
|
||||
| "pthread_attr_setstacksize"
|
||||
if this.frame().instance.to_string().starts_with("std::sys::unix::") => {
|
||||
let &[_, _] = check_arg_count(args)?;
|
||||
|
@ -129,14 +129,14 @@ fn mutex_set_kind<'mir, 'tcx: 'mir>(
|
||||
fn mutex_get_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &MiriEvalContext<'mir, 'tcx>,
|
||||
mutex_op: OpTy<'tcx, Tag>,
|
||||
) -> InterpResult<'tcx, ScalarMaybeUndef<Tag>> {
|
||||
) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
|
||||
get_at_offset(ecx, mutex_op, 4, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE)
|
||||
}
|
||||
|
||||
fn mutex_set_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &mut MiriEvalContext<'mir, 'tcx>,
|
||||
mutex_op: OpTy<'tcx, Tag>,
|
||||
id: impl Into<ScalarMaybeUndef<Tag>>,
|
||||
id: impl Into<ScalarMaybeUninit<Tag>>,
|
||||
) -> InterpResult<'tcx, ()> {
|
||||
set_at_offset(ecx, mutex_op, 4, id, ecx.machine.layouts.u32, PTHREAD_MUTEX_T_MIN_SIZE)
|
||||
}
|
||||
@ -176,7 +176,7 @@ fn rwlock_get_id<'mir, 'tcx: 'mir>(
|
||||
fn rwlock_set_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &mut MiriEvalContext<'mir, 'tcx>,
|
||||
rwlock_op: OpTy<'tcx, Tag>,
|
||||
id: impl Into<ScalarMaybeUndef<Tag>>,
|
||||
id: impl Into<ScalarMaybeUninit<Tag>>,
|
||||
) -> InterpResult<'tcx, ()> {
|
||||
set_at_offset(ecx, rwlock_op, 4, id, ecx.machine.layouts.u32, PTHREAD_RWLOCK_T_MIN_SIZE)
|
||||
}
|
||||
@ -208,14 +208,14 @@ const PTHREAD_CONDATTR_T_MIN_SIZE: u64 = 4;
|
||||
fn condattr_get_clock_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &MiriEvalContext<'mir, 'tcx>,
|
||||
attr_op: OpTy<'tcx, Tag>,
|
||||
) -> InterpResult<'tcx, ScalarMaybeUndef<Tag>> {
|
||||
) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
|
||||
get_at_offset(ecx, attr_op, 0, ecx.machine.layouts.i32, PTHREAD_CONDATTR_T_MIN_SIZE)
|
||||
}
|
||||
|
||||
fn condattr_set_clock_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &mut MiriEvalContext<'mir, 'tcx>,
|
||||
attr_op: OpTy<'tcx, Tag>,
|
||||
clock_id: impl Into<ScalarMaybeUndef<Tag>>,
|
||||
clock_id: impl Into<ScalarMaybeUninit<Tag>>,
|
||||
) -> InterpResult<'tcx, ()> {
|
||||
set_at_offset(ecx, attr_op, 0, clock_id, ecx.machine.layouts.i32, PTHREAD_CONDATTR_T_MIN_SIZE)
|
||||
}
|
||||
@ -234,14 +234,14 @@ const PTHREAD_COND_T_MIN_SIZE: u64 = 12;
|
||||
fn cond_get_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &MiriEvalContext<'mir, 'tcx>,
|
||||
cond_op: OpTy<'tcx, Tag>,
|
||||
) -> InterpResult<'tcx, ScalarMaybeUndef<Tag>> {
|
||||
) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
|
||||
get_at_offset(ecx, cond_op, 4, ecx.machine.layouts.u32, PTHREAD_COND_T_MIN_SIZE)
|
||||
}
|
||||
|
||||
fn cond_set_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &mut MiriEvalContext<'mir, 'tcx>,
|
||||
cond_op: OpTy<'tcx, Tag>,
|
||||
id: impl Into<ScalarMaybeUndef<Tag>>,
|
||||
id: impl Into<ScalarMaybeUninit<Tag>>,
|
||||
) -> InterpResult<'tcx, ()> {
|
||||
set_at_offset(ecx, cond_op, 4, id, ecx.machine.layouts.u32, PTHREAD_COND_T_MIN_SIZE)
|
||||
}
|
||||
@ -265,14 +265,14 @@ fn cond_get_or_create_id<'mir, 'tcx: 'mir>(
|
||||
fn cond_get_clock_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &MiriEvalContext<'mir, 'tcx>,
|
||||
cond_op: OpTy<'tcx, Tag>,
|
||||
) -> InterpResult<'tcx, ScalarMaybeUndef<Tag>> {
|
||||
) -> InterpResult<'tcx, ScalarMaybeUninit<Tag>> {
|
||||
get_at_offset(ecx, cond_op, 8, ecx.machine.layouts.i32, PTHREAD_COND_T_MIN_SIZE)
|
||||
}
|
||||
|
||||
fn cond_set_clock_id<'mir, 'tcx: 'mir>(
|
||||
ecx: &mut MiriEvalContext<'mir, 'tcx>,
|
||||
cond_op: OpTy<'tcx, Tag>,
|
||||
clock_id: impl Into<ScalarMaybeUndef<Tag>>,
|
||||
clock_id: impl Into<ScalarMaybeUninit<Tag>>,
|
||||
) -> InterpResult<'tcx, ()> {
|
||||
set_at_offset(ecx, cond_op, 8, clock_id, ecx.machine.layouts.i32, PTHREAD_COND_T_MIN_SIZE)
|
||||
}
|
||||
@ -518,8 +518,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
throw_ub_format!("destroyed a locked mutex");
|
||||
}
|
||||
|
||||
mutex_set_kind(this, mutex_op, ScalarMaybeUndef::Undef)?;
|
||||
mutex_set_id(this, mutex_op, ScalarMaybeUndef::Undef)?;
|
||||
mutex_set_kind(this, mutex_op, ScalarMaybeUninit::Uninit)?;
|
||||
mutex_set_id(this, mutex_op, ScalarMaybeUninit::Uninit)?;
|
||||
|
||||
Ok(0)
|
||||
}
|
||||
@ -643,7 +643,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
throw_ub_format!("destroyed a locked rwlock");
|
||||
}
|
||||
|
||||
rwlock_set_id(this, rwlock_op, ScalarMaybeUndef::Undef)?;
|
||||
rwlock_set_id(this, rwlock_op, ScalarMaybeUninit::Uninit)?;
|
||||
|
||||
Ok(0)
|
||||
}
|
||||
@ -696,7 +696,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
fn pthread_condattr_destroy(&mut self, attr_op: OpTy<'tcx, Tag>) -> InterpResult<'tcx, i32> {
|
||||
let this = self.eval_context_mut();
|
||||
|
||||
condattr_set_clock_id(this, attr_op, ScalarMaybeUndef::Undef)?;
|
||||
condattr_set_clock_id(this, attr_op, ScalarMaybeUninit::Uninit)?;
|
||||
|
||||
Ok(0)
|
||||
}
|
||||
@ -835,8 +835,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
if this.condvar_is_awaited(id) {
|
||||
throw_ub_format!("destroyed an awaited conditional variable");
|
||||
}
|
||||
cond_set_id(this, cond_op, ScalarMaybeUndef::Undef)?;
|
||||
cond_set_clock_id(this, cond_op, ScalarMaybeUndef::Undef)?;
|
||||
cond_set_id(this, cond_op, ScalarMaybeUninit::Uninit)?;
|
||||
cond_set_clock_id(this, cond_op, ScalarMaybeUninit::Uninit)?;
|
||||
|
||||
Ok(0)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user