diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-09 11:10:04 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-03-09 11:10:04 -0300 |
commit | 1de2f31694ddbc86b18e491c8aedc91791f512e2 (patch) | |
tree | 01fa1b5fe0cce50c062f8ed07f98741b339bbb66 /ltable.c | |
parent | 02bab9fc258fe1cbc6088b1bd61193499d058eff (diff) | |
download | lua-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |