git: f3e22a08ca69 - stable/14 - atomic: Fix the cast in the atomic_load_consume() interceptor
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 05 Sep 2024 13:46:15 UTC
The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f3e22a08ca690bf3a80688641b9705aa2e1cb15c commit f3e22a08ca690bf3a80688641b9705aa2e1cb15c Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-08-28 19:25:11 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-09-05 13:44:00 +0000 atomic: Fix the cast in the atomic_load_consume() interceptor As in commit c7a7e997d25d0, we should permit loading from a pointer to uintptr_t. Note that the other atomic_*_ptr() interfaces currently require casting regardless, only those defined in atomic_common.h try to be generic. Reported by: jrtc27 MFC after: 1 week (cherry picked from commit cb91dc50950ffdfd49337e844e231b69b8b5c634) --- sys/sys/atomic_san.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index ef81b4b7c51e..e22324b87623 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -270,7 +270,7 @@ ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); __DECONST(volatile uintptr_t *, (x)))) #define atomic_load_acq_ptr ATOMIC_SAN(load_acq_ptr) #define atomic_load_consume_ptr(x) \ - ((void *)atomic_load_acq_ptr((volatile uintptr_t *)(x))) + ((__typeof(*x))atomic_load_acq_ptr((volatile uintptr_t *)(x))) #define atomic_readandclear_ptr ATOMIC_SAN(readandclear_ptr) #define atomic_set_ptr ATOMIC_SAN(set_ptr) #define atomic_set_acq_ptr ATOMIC_SAN(set_acq_ptr)