diff options
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -609,6 +609,7 @@ static int traverseLclosure (global_State *g, LClosure *cl) { | |||
609 | ** That ensures that the entire stack have valid (non-dead) objects. | 609 | ** That ensures that the entire stack have valid (non-dead) objects. |
610 | */ | 610 | */ |
611 | static int traversethread (global_State *g, lua_State *th) { | 611 | static int traversethread (global_State *g, lua_State *th) { |
612 | UpVal *uv; | ||
612 | StkId o = th->stack; | 613 | StkId o = th->stack; |
613 | if (o == NULL) | 614 | if (o == NULL) |
614 | return 1; /* stack not completely built yet */ | 615 | return 1; /* stack not completely built yet */ |
@@ -616,6 +617,10 @@ static int traversethread (global_State *g, lua_State *th) { | |||
616 | th->openupval == NULL || isintwups(th)); | 617 | th->openupval == NULL || isintwups(th)); |
617 | for (; o < th->top; o++) /* mark live elements in the stack */ | 618 | for (; o < th->top; o++) /* mark live elements in the stack */ |
618 | markvalue(g, s2v(o)); | 619 | markvalue(g, s2v(o)); |
620 | for (uv = th->openupval; uv != NULL; uv = uv->u.open.next) { | ||
621 | if (uv->tt == LUA_TUPVALTBC) /* to be closed? */ | ||
622 | markobject(g, uv); /* cannot be collected */ | ||
623 | } | ||
619 | if (g->gcstate == GCSatomic) { /* final traversal? */ | 624 | if (g->gcstate == GCSatomic) { /* final traversal? */ |
620 | StkId lim = th->stack + th->stacksize; /* real end of stack */ | 625 | StkId lim = th->stack + th->stacksize; /* real end of stack */ |
621 | for (; o < lim; o++) /* clear not-marked stack slice */ | 626 | for (; o < lim; o++) /* clear not-marked stack slice */ |