From 37c14bc7459e8b9cc0840b68223123ffb950b4cc Mon Sep 17 00:00:00 2001 From: prrace Date: Mon, 17 Dec 2018 14:59:37 -0800 Subject: [PATCH] Fix Solaris use after free (#1495) --- src/hb-atomic.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-atomic.hh b/src/hb-atomic.hh index 7df4fe986..9321932e0 100644 --- a/src/hb-atomic.hh +++ b/src/hb-atomic.hh @@ -143,7 +143,7 @@ static_assert ((sizeof (LONG) == sizeof (int)), ""); static inline int _hb_fetch_and_add (int *AI, int V) { _hb_memory_w_barrier (); - int result = atomic_add_int_nv ((uint_t *) AI, V); + int result = atomic_add_int_nv ((uint_t *) AI, V) - V; _hb_memory_r_barrier (); return result; }