mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Fix undefined behavior in table resizing calculation.
This commit is contained in:
parent
419cbb3aa9
commit
c56811bb7a
@ -357,7 +357,8 @@ static void rehashtab(lua_State *L, GCtab *t, cTValue *ek)
|
||||
uint32_t total, asize, na, i;
|
||||
for (i = 0; i < LJ_MAX_ABITS; i++) bins[i] = 0;
|
||||
asize = countarray(t, bins);
|
||||
total = 1 + asize + counthash(t, bins, &asize);
|
||||
total = 1 + asize;
|
||||
total += counthash(t, bins, &asize);
|
||||
asize += countint(ek, bins);
|
||||
na = bestasize(bins, &asize);
|
||||
total -= na;
|
||||
|
Loading…
Reference in New Issue
Block a user