mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-07 06:53:33 +00:00
Use unsigned-signed conversion for refs test (#1272)
This commit is contained in:
parent
75e161b27b
commit
389d565d46
1 changed files with 2 additions and 2 deletions
|
@ -43,8 +43,8 @@ incref(size_t* r) noexcept
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
__atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
__atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
||||||
#else
|
#else
|
||||||
size_t refs = __atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
ssize_t refs = __atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
||||||
if (refs > ((size_t)-1) >> 1)
|
if (refs < 0)
|
||||||
__builtin_trap();
|
__builtin_trap();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue