mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-01-31 03:27:39 +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
|
||||
__atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
||||
#else
|
||||
size_t refs = __atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
||||
if (refs > ((size_t)-1) >> 1)
|
||||
ssize_t refs = __atomic_fetch_add(r, 1, __ATOMIC_RELAXED);
|
||||
if (refs < 0)
|
||||
__builtin_trap();
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue