]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix GC step size calculation.
authorMike Pall <mike>
Thu, 13 Oct 2016 16:36:39 +0000 (18:36 +0200)
committerMike Pall <mike>
Thu, 13 Oct 2016 16:37:58 +0000 (18:37 +0200)
Thanks to Igor Ehrlich.

src/lj_gc.c

index c5ff1f049fc9cc16eed8905c5da2e372c4c99d1b..2c447c79358c61dee7debed6238f9c47fea97970 100644 (file)
@@ -307,7 +307,7 @@ static size_t propagatemark(global_State *g)
     if (gc_traverse_tab(g, t) > 0)
       black2gray(o);  /* Keep weak tables gray. */
     return sizeof(GCtab) + sizeof(TValue) * t->asize +
-                          sizeof(Node) * (t->hmask + 1);
+                          (t->hmask ? sizeof(Node) * (t->hmask + 1) : 0);
   } else if (LJ_LIKELY(gct == ~LJ_TFUNC)) {
     GCfunc *fn = gco2func(o);
     gc_traverse_func(g, fn);