Code comment changes from code review
Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
parent
250d450593
commit
fd830e7b27
1 changed files with 2 additions and 0 deletions
|
|
@ -367,6 +367,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
// Destroying an uninit pthread_mutexattr is UB, so check to make sure it's not uninit.
|
||||
mutexattr_get_kind(this, attr_op)?.check_init()?;
|
||||
|
||||
// To catch double-destroys, we de-initialize the mutexattr.
|
||||
// This is technically not right and might lead to false positives. For example, the below
|
||||
// code is *likely* sound, even assuming uninit numbers are UB, but miri with
|
||||
// -Zmiri-check-number-validity complains
|
||||
|
|
@ -376,6 +377,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
// libc::pthread_mutexattr_destroy(x.as_mut_ptr());
|
||||
// x.assume_init();
|
||||
//
|
||||
// However, the way libstd uses the pthread APIs works in our favor here, so we can get away with this.
|
||||
// This can always be revisited to have some external state to catch double-destroys
|
||||
// but not complain about the above code. See https://github.com/rust-lang/miri/pull/1933
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue