Message ID | 3dde633646a3e76217744dbd9e151a4e913a2e88.1380721529.git.baruch@tkos.co.il |
---|---|
State | Accepted, archived |
Headers | show |
On Wed, Oct 02, 2013 at 04:45:54PM +0300, Baruch Siach wrote: >atomic_decrement_if_positive() returns the old value of &mem, not the >(sometimes undefined) value of __tmp. > >Fixes the uClibc nptl/tst-sem3 test. Applied, thanks!
diff --git a/libc/sysdeps/linux/xtensa/bits/atomic.h b/libc/sysdeps/linux/xtensa/bits/atomic.h index a31841a..b2be547 100644 --- a/libc/sysdeps/linux/xtensa/bits/atomic.h +++ b/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; \ })
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> --- libc/sysdeps/linux/xtensa/bits/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)