From 1de2f31694ddbc86b18e491c8aedc91791f512e2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 9 Mar 2023 11:10:04 -0300 Subject: Corrected support for 16-bit systems We still need access to a 16-bit system to correctly test these changes. --- ltable.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index cc7993e0..3c690c5f 100644 --- a/ltable.c +++ b/ltable.c @@ -257,9 +257,11 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) { size |= (size >> 2); size |= (size >> 4); size |= (size >> 8); +#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */ size |= (size >> 16); #if (UINT_MAX >> 30) > 3 size |= (size >> 32); /* unsigned int has more than 32 bits */ +#endif #endif size++; lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); -- cgit v1.2.3-55-g6feb