aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-03-09 11:10:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-03-09 11:10:04 -0300
commit1de2f31694ddbc86b18e491c8aedc91791f512e2 (patch)
tree01fa1b5fe0cce50c062f8ed07f98741b339bbb66 /ltable.c
parent02bab9fc258fe1cbc6088b1bd61193499d058eff (diff)
downloadlua-1de2f31694ddbc86b18e491c8aedc91791f512e2.tar.gz
lua-1de2f31694ddbc86b18e491c8aedc91791f512e2.tar.bz2
lua-1de2f31694ddbc86b18e491c8aedc91791f512e2.zip
Corrected support for 16-bit systems
We still need access to a 16-bit system to correctly test these changes.
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ltable.c b/ltable.c
index cc7993e0..3c690c5f 100644
--- a/ltable.c
+++ b/ltable.c
@@ -257,10 +257,12 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
257 size |= (size >> 2); 257 size |= (size >> 2);
258 size |= (size >> 4); 258 size |= (size >> 4);
259 size |= (size >> 8); 259 size |= (size >> 8);
260#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */
260 size |= (size >> 16); 261 size |= (size >> 16);
261#if (UINT_MAX >> 30) > 3 262#if (UINT_MAX >> 30) > 3
262 size |= (size >> 32); /* unsigned int has more than 32 bits */ 263 size |= (size >> 32); /* unsigned int has more than 32 bits */
263#endif 264#endif
265#endif
264 size++; 266 size++;
265 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); 267 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
266 return size; 268 return size;