aboutsummaryrefslogtreecommitdiff
path: root/lgc.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-11-08 11:52:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-11-08 11:52:26 -0300
commitd28265256110a0c5437247d443ddedc2a7aab116 (patch)
treee1aacb5eaa1ef67127aa8206e85eee32d36697be /lgc.c
parent58216600eba27d472de33dbb89e2f3e629bf8a59 (diff)
downloadlua-d28265256110a0c5437247d443ddedc2a7aab116.tar.gz
lua-d28265256110a0c5437247d443ddedc2a7aab116.tar.bz2
lua-d28265256110a0c5437247d443ddedc2a7aab116.zip
Bug when growing a stack
When a stack grows, its extra area can be in use, and it becomes part of the common area. So, the extra area must be kept correct all the times. (Bug introduced by commit 5aa36e894f5.)
Diffstat (limited to '')
-rw-r--r--lgc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lgc.c b/lgc.c
index 5dba56fc..bab9beb1 100644
--- a/lgc.c
+++ b/lgc.c
@@ -632,8 +632,8 @@ static int traversethread (global_State *g, lua_State *th) {
632 for (uv = th->openupval; uv != NULL; uv = uv->u.open.next) 632 for (uv = th->openupval; uv != NULL; uv = uv->u.open.next)
633 markobject(g, uv); /* open upvalues cannot be collected */ 633 markobject(g, uv); /* open upvalues cannot be collected */
634 if (g->gcstate == GCSatomic) { /* final traversal? */ 634 if (g->gcstate == GCSatomic) { /* final traversal? */
635 for (; o < th->stack_last; o++) /* clear not-marked stack slice */ 635 for (; o < th->stack_last + EXTRA_STACK; o++)
636 setnilvalue(s2v(o)); 636 setnilvalue(s2v(o)); /* clear dead stack slice */
637 /* 'remarkupvals' may have removed thread from 'twups' list */ 637 /* 'remarkupvals' may have removed thread from 'twups' list */
638 if (!isintwups(th) && th->openupval != NULL) { 638 if (!isintwups(th) && th->openupval != NULL) {
639 th->twups = g->twups; /* link it back to the list */ 639 th->twups = g->twups; /* link it back to the list */