From 643e70c130b2629be12e95574e42addb618045af Mon Sep 17 00:00:00 2001 From: Igor Ehrlich Date: Wed, 12 Oct 2016 18:42:36 +0300 Subject: [PATCH] Fixed return value of propagatemark in case of propagating a table with empty hash part --- src/lj_gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lj_gc.c b/src/lj_gc.c index c5ff1f04..f314aa23 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c @@ -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);