Add note about use of force_ptr in futex implementation.

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Mara Bos 2020-10-03 14:21:37 +02:00 committed by GitHub
parent dfcb46a4e0
commit c268ee2bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -30,6 +30,8 @@ pub fn futex<'tcx>(
// The raw pointer value is used to identify the mutex.
// Not all mutex operations actually read from this address or even require this address to exist.
// This will make FUTEX_WAKE fail on an integer cast to a pointer. But FUTEX_WAIT on
// such a pointer can never work anyway, so that seems fine.
let futex_ptr = this.force_ptr(addr.to_scalar()?)?;
let thread = this.get_active_thread();