From 68776d292196f4e890f860c1464ecc83af80859f Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 3 Oct 2020 14:32:30 +0200 Subject: [PATCH] Add FIXME about type of `addr` in futex implementation. Co-authored-by: Ralf Jung --- src/shims/posix/linux/sync.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shims/posix/linux/sync.rs b/src/shims/posix/linux/sync.rs index 09558554aa2..d7ecb45279d 100644 --- a/src/shims/posix/linux/sync.rs +++ b/src/shims/posix/linux/sync.rs @@ -77,6 +77,7 @@ pub fn futex<'tcx>( this.memory.check_ptr_access(addr.to_scalar()?, Size::from_bytes(4), Align::from_bytes(4).unwrap())?; // Read an `i32` through the pointer, regardless of any wrapper types. // It's not uncommon for `addr` to be passed as another type than `*mut i32`, such as `*const AtomicI32`. + // FIXME: this fails if `addr` is not a pointer type. let futex_val = this.read_scalar_at_offset(addr.into(), 0, this.machine.layouts.i32)?.to_i32()?; if val == futex_val { // The value still matches, so we block the trait make it wait for FUTEX_WAKE. -- 2.44.0