From 5e685a99d5df3a9c514ee0da3a53ed8eafb9ce8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Fri, 1 Dec 2023 12:02:52 -0500 Subject: [PATCH] refs is atomic_size_t The unassert covers all invalid values rather than a third of them. --- libc/runtime/zipos-open.c | 2 +- libc/runtime/zipos.internal.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/runtime/zipos-open.c b/libc/runtime/zipos-open.c index 0d3c7780c..b24153ea0 100644 --- a/libc/runtime/zipos-open.c +++ b/libc/runtime/zipos-open.c @@ -51,7 +51,7 @@ #include "libc/thread/tls.h" #include "libc/zip.internal.h" -#define MAX_REFS (INT_MAX >> 1) +#define MAX_REFS SSIZE_MAX static char *__zipos_mapend; static size_t __zipos_maptotal; diff --git a/libc/runtime/zipos.internal.h b/libc/runtime/zipos.internal.h index 0cd1979bf..30fbf9adc 100644 --- a/libc/runtime/zipos.internal.h +++ b/libc/runtime/zipos.internal.h @@ -21,7 +21,7 @@ struct ZiposHandle { size_t size; size_t mapsize; size_t cfile; - _Atomic(int) refs; + _Atomic(size_t) refs; _Atomic(size_t) pos; uint8_t *mem; uint8_t data[];