aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-09 14:00:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-02-09 14:00:05 -0300
commit4e47f81188d37e29027158b76271d02a781242e2 (patch)
treec360912d1901acf8371390cc1f716278e5d91bb4 /ldo.c
parentc63e5d212bc5dec1b1c749e3f07b42cd83081826 (diff)
downloadlua-4e47f81188d37e29027158b76271d02a781242e2.tar.gz
lua-4e47f81188d37e29027158b76271d02a781242e2.tar.bz2
lua-4e47f81188d37e29027158b76271d02a781242e2.zip
New implementation for to-be-closed variables
To-be-closed variables are linked in their own list, embedded into the stack elements. (Due to alignment, this information does not change the size of the stack elements in most architectures.) This new list does not produce garbage and avoids memory errors when creating tbc variables.
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ldo.c b/ldo.c
index 65f0a7b9..bc7212c6 100644
--- a/ldo.c
+++ b/ldo.c
@@ -163,7 +163,7 @@ static void correctstack (lua_State *L, StkId oldstack, StkId newstack) {
163 if (oldstack == newstack) 163 if (oldstack == newstack)
164 return; /* stack address did not change */ 164 return; /* stack address did not change */
165 L->top = (L->top - oldstack) + newstack; 165 L->top = (L->top - oldstack) + newstack;
166 lua_assert(L->ptbc == NULL); 166 L->tbclist = (L->tbclist - oldstack) + newstack;
167 for (up = L->openupval; up != NULL; up = up->u.open.next) 167 for (up = L->openupval; up != NULL; up = up->u.open.next)
168 up->v = s2v((uplevel(up) - oldstack) + newstack); 168 up->v = s2v((uplevel(up) - oldstack) + newstack);
169 for (ci = L->ci; ci != NULL; ci = ci->previous) { 169 for (ci = L->ci; ci != NULL; ci = ci->previous) {