Fix Solaris use after free (#1495)

This commit is contained in:
prrace 2018-12-17 14:59:37 -08:00 committed by Behdad Esfahbod
parent 483f2491e4
commit 37c14bc745
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}