aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-18 14:58:21 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-06-18 14:58:21 -0300
commita314409dba5579b3523460f4e385574fce40aeb2 (patch)
tree3377387ee942a2a15539c8bc066a7cb10a653221
parent15ce8d09040c07e5c738f9ffbb5a71a913b4be65 (diff)
downloadlua-a314409dba5579b3523460f4e385574fce40aeb2.tar.gz
lua-a314409dba5579b3523460f4e385574fce40aeb2.tar.bz2
lua-a314409dba5579b3523460f4e385574fce40aeb2.zip
in generational mode, an emergency collection can turn any object black
during any memory allocation + 'luaT_getvarargs' may reallocate the stack, and therefore the top must be correct.
-rw-r--r--lvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index 1e45e2ce..9e8bec0c 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.357 2018/06/01 16:51:34 roberto Exp roberto $ 2** $Id: lvm.c,v 2.358 2018/06/15 14:14:20 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -712,7 +712,7 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base,
712 ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); 712 ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx);
713 else /* get upvalue from enclosing function */ 713 else /* get upvalue from enclosing function */
714 ncl->upvals[i] = encup[uv[i].idx]; 714 ncl->upvals[i] = encup[uv[i].idx];
715 /* new closure is white, so we do not need a barrier here */ 715 luaC_objbarrier(L, ncl, ncl->upvals[i]);
716 } 716 }
717 if (p->cachemiss >= MAXMISS) /* too many missings? */ 717 if (p->cachemiss >= MAXMISS) /* too many missings? */
718 p->cache = NULL; /* give up cache */ 718 p->cache = NULL; /* give up cache */
@@ -1790,7 +1790,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
1790 } 1790 }
1791 vmcase(OP_VARARG) { 1791 vmcase(OP_VARARG) {
1792 int n = GETARG_C(i) - 1; /* required results */ 1792 int n = GETARG_C(i) - 1; /* required results */
1793 ProtectNT(luaT_getvarargs(L, ci, ra, n)); 1793 Protect(luaT_getvarargs(L, ci, ra, n));
1794 vmbreak; 1794 vmbreak;
1795 } 1795 }
1796 vmcase(OP_PREPVARARG) { 1796 vmcase(OP_PREPVARARG) {