diff --git a/src/lgc.c b/src/lgc.c index 1eb49dc..c52da1c 100644 --- a/src/lgc.c +++ b/src/lgc.c @@ -187,7 +187,7 @@ static int traversetable (global_State *g, Table *h) { if (weakkey && weakvalue) return 1; i = h->sizearray; while (i--) - if (!weakvalue || ttisrope(&h->array[i]) || ttissubstr(&h->array[i])) markvalue(g, &h->array[i]); + if (!weakvalue) markvalue(g, &h->array[i]); i = sizenode(h); while (i--) { Node *n = gnode(h, i); @@ -196,8 +196,8 @@ static int traversetable (global_State *g, Table *h) { removeentry(n); /* remove empty entries */ else { lua_assert(!ttisnil(gkey(n))); - if (!weakkey || ttisrope(gkey(n)) || ttissubstr(gkey(n))) markvalue(g, gkey(n)); - if (!weakvalue || ttisrope(gval(n)) || ttissubstr(gval(n))) markvalue(g, gval(n)); + if (!weakkey) markvalue(g, gkey(n)); + if (!weakvalue) markvalue(g, gval(n)); } } return weakkey || weakvalue; diff --git a/src/lstring.c b/src/lstring.c index 77fc0e4..a3b02de 100644 --- a/src/lstring.c +++ b/src/lstring.c @@ -180,6 +180,7 @@ TString *luaS_build (lua_State *L, TRope *rope) { /* (apparently this is a problem?) */ resetbits(s->tsv.marked, WHITEBITS); setbits(s->tsv.marked, bitmask(BLACKBIT)); + luaC_step(L); /* try to let the old rope get freed */ return s; }