aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-22 11:41:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-06-22 11:41:48 -0300
commitab6a94952215b1f66436d8eeebded1dad9fa5409 (patch)
treeba66254537defc76602ce351d962b899ddfe1b29 /ltable.c
parent86e8039a72646cd9192fd08a6f1771c90b872ff6 (diff)
parentea39042e13645f63713425c05cc9ee4cfdcf0a40 (diff)
downloadlua-ab6a94952215b1f66436d8eeebded1dad9fa5409.tar.gz
lua-ab6a94952215b1f66436d8eeebded1dad9fa5409.tar.bz2
lua-ab6a94952215b1f66436d8eeebded1dad9fa5409.zip
Merge branch 'master' into nextversion
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ltable.c b/ltable.c
index 485563f3..8db26bdc 100644
--- a/ltable.c
+++ b/ltable.c
@@ -278,10 +278,12 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) {
278 size |= (size >> 2); 278 size |= (size >> 2);
279 size |= (size >> 4); 279 size |= (size >> 4);
280 size |= (size >> 8); 280 size |= (size >> 8);
281#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */
281 size |= (size >> 16); 282 size |= (size >> 16);
282#if (UINT_MAX >> 30) > 3 283#if (UINT_MAX >> 30) > 3
283 size |= (size >> 32); /* unsigned int has more than 32 bits */ 284 size |= (size >> 32); /* unsigned int has more than 32 bits */
284#endif 285#endif
286#endif
285 size++; 287 size++;
286 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); 288 lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size);
287 return size; 289 return size;
@@ -710,7 +712,8 @@ static Node *getfreepos (Table *t) {
710** put new key in its main position; otherwise (colliding node is in its main 712** put new key in its main position; otherwise (colliding node is in its main
711** position), new key goes to an empty position. 713** position), new key goes to an empty position.
712*/ 714*/
713void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { 715static void luaH_newkey (lua_State *L, Table *t, const TValue *key,
716 TValue *value) {
714 Node *mp; 717 Node *mp;
715 TValue aux; 718 TValue aux;
716 if (l_unlikely(ttisnil(key))) 719 if (l_unlikely(ttisnil(key)))