diff --git a/src/bluajit/lj_tab.c b/src/bluajit/lj_tab.c index 869c5f03c..27b3021dd 100644 --- a/src/bluajit/lj_tab.c +++ b/src/bluajit/lj_tab.c @@ -359,8 +359,14 @@ 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); +#if 0 total = 1 + asize; total += counthash(t, bins, &asize); +#else + /* more closely matches vanilla lua when abusing undefined behavior (frictionfix.....) */ + total = counthash(t, bins, &asize); + total += 1 + asize; +#endif asize += countint(ek, bins); na = bestasize(bins, &asize); total -= na;