summaryrefslogtreecommitdiff
path: root/src/lj_obj.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_obj.h')
-rw-r--r--src/lj_obj.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_obj.h b/src/lj_obj.h
index ea8fe870..ef45ae12 100644
--- a/src/lj_obj.h
+++ b/src/lj_obj.h
@@ -327,7 +327,7 @@ typedef struct GCproto {
#define PROTO_UV_IMMUTABLE 0x4000 /* Immutable upvalue. */
#define proto_kgc(pt, idx) \
- check_exp((uintptr_t)(intptr_t)(idx) >= (uintptr_t)-(intptr_t)(pt)->sizekgc, \
+ check_exp((uintptr_t)(intptr_t)(idx) >= ~(uintptr_t)(pt)->sizekgc+1u, \
gcref(mref((pt)->k, GCRef)[(idx)]))
#define proto_knumtv(pt, idx) \
check_exp((uintptr_t)(idx) < (pt)->sizekn, &mref((pt)->k, TValue)[(idx)])