|
@@ -632,8 +632,8 @@ static int traversethread (global_State *g, lua_State *th) {
|
|
|
for (uv = th->openupval; uv != NULL; uv = uv->u.open.next)
|
|
|
markobject(g, uv); /* open upvalues cannot be collected */
|
|
|
if (g->gcstate == GCSatomic) { /* final traversal? */
|
|
|
- for (; o < th->stack_last; o++) /* clear not-marked stack slice */
|
|
|
- setnilvalue(s2v(o));
|
|
|
+ for (; o < th->stack_last + EXTRA_STACK; o++)
|
|
|
+ setnilvalue(s2v(o)); /* clear dead stack slice */
|
|
|
/* 'remarkupvals' may have removed thread from 'twups' list */
|
|
|
if (!isintwups(th) && th->openupval != NULL) {
|
|
|
th->twups = g->twups; /* link it back to the list */
|