summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-12-20 10:22:20 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-12-20 10:22:20 +0300
commit8f1a99af4d41eca6bca8f7114d7178bac8e6f182 (patch)
tree9dd22cb6ed86ec00a71d1989e41f123204430f86 /src
parentfdd2d82517d5ad510aec2077966d6218ea651bd7 (diff)
downloadlibatomic_ops-8f1a99af4d41eca6bca8f7114d7178bac8e6f182.tar.gz
Eliminate GCC-5 ASan global-buffer-overflow false positive for AO_stack_bl
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE] (AO_stack_push_explicit_aux_release): Replace a->AO_stack_bl+i with &a->AO_stack_bl[i] (including the case of i==0).
Diffstat (limited to 'src')
-rw-r--r--src/atomic_ops_stack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c
index 0a6124a..049df98 100644
--- a/src/atomic_ops_stack.c
+++ b/src/atomic_ops_stack.c
@@ -66,8 +66,8 @@ void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x,
# if AO_BL_SIZE == 2
{
/* Start all loads as close to concurrently as possible. */
- AO_t entry1 = AO_load(a -> AO_stack_bl);
- AO_t entry2 = AO_load(a -> AO_stack_bl + 1);
+ AO_t entry1 = AO_load(&a->AO_stack_bl[0]);
+ AO_t entry2 = AO_load(&a->AO_stack_bl[1]);
if (entry1 == x_bits || entry2 == x_bits)
{
/* Entry is currently being removed. Change it a little. */
@@ -84,7 +84,7 @@ void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x,
int i;
for (i = 0; i < AO_BL_SIZE; ++i)
{
- if (AO_load(a -> AO_stack_bl + i) == x_bits)
+ if (AO_load(&a->AO_stack_bl[i]) == x_bits)
{
/* Entry is currently being removed. Change it a little. */
++x_bits;