소스 검색

xtensa: fix atomic_decrement_if_positive() return value

atomic_decrement_if_positive() returns the old value of &mem, not the
(sometimes undefined) value of __tmp.

Fixes the uClibc nptl/tst-sem3 test.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Chris Zankel <chris@zankel.net>
Baruch Siach 10 년 전
부모
커밋
a20d9fe539
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      libc/sysdeps/linux/xtensa/bits/atomic.h

+ 1 - 1
libc/sysdeps/linux/xtensa/bits/atomic.h

@@ -154,7 +154,7 @@ typedef uintmax_t uatomic_max_t;
       : "=&a" (__value), "=&a" (__tmp)                               \
       : "a" (mem)                                                    \
       : "memory" );                                                  \
-    __tmp;                                                           \
+    __value;                                                         \
   })