Merge pull request #9471 from douzzer/20251124-memory_test-wolfSSL_Atomic_Ptr_CompareExchange

20251124-memory_test-wolfSSL_Atomic_Ptr_CompareExchange
This commit is contained in:
Sean Parkinson
2025-11-25 19:22:22 +10:00
committed by GitHub
5 changed files with 26 additions and 20 deletions

View File

@@ -1359,7 +1359,7 @@ int wolfSSL_Atomic_Uint_CompareExchange(
}
int wolfSSL_Atomic_Ptr_CompareExchange(
void **c, void **expected_ptr, void *new_ptr)
void * volatile *c, void **expected_ptr, void *new_ptr)
{
uintptr_t exp = (uintptr_t)*expected_ptr;
int ret = atomic_fcmpset_ptr((uintptr_t *)c, &exp, (uintptr_t)new_ptr);
@@ -1456,7 +1456,7 @@ int wolfSSL_Atomic_Uint_CompareExchange(
}
int wolfSSL_Atomic_Ptr_CompareExchange(
void **c, void **expected_ptr, void *new_ptr)
void * volatile *c, void **expected_ptr, void *new_ptr)
{
/* use gcc-built-in __atomic_compare_exchange_n(), not
* atomic_compare_exchange_strong_explicit(), to sidestep _Atomic type
@@ -1551,7 +1551,7 @@ int wolfSSL_Atomic_Uint_CompareExchange(
}
int wolfSSL_Atomic_Ptr_CompareExchange(
void **c, void **expected_ptr, void *new_ptr)
void * volatile *c, void **expected_ptr, void *new_ptr)
{
return __atomic_compare_exchange_n(
c, expected_ptr, new_ptr, 0 /* weak */,
@@ -1651,7 +1651,7 @@ int wolfSSL_Atomic_Uint_CompareExchange(
}
int wolfSSL_Atomic_Ptr_CompareExchange(
void ** c, void **expected_ptr, void *new_ptr)
void * volatile * c, void **expected_ptr, void *new_ptr)
{
#ifdef _WIN64
LONG64 actual_ptr = InterlockedCompareExchange64(