diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-11-08 11:52:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-11-08 11:52:26 -0300 |
commit | d28265256110a0c5437247d443ddedc2a7aab116 (patch) | |
tree | e1aacb5eaa1ef67127aa8206e85eee32d36697be /lgc.c | |
parent | 58216600eba27d472de33dbb89e2f3e629bf8a59 (diff) | |
download | lua-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 */ |