mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 16:30:29 +00:00
Use unsigned-signed conversion for refs test
This commit is contained in:
parent
e1528a71e2
commit
57c6e43346
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…
Add table
Add a link
Reference in a new issue