lua

A copy of the Lua development repository
Log | Files | Refs | README

commit a314409dba5579b3523460f4e385574fce40aeb2
parent 15ce8d09040c07e5c738f9ffbb5a71a913b4be65
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 18 Jun 2018 14:57:54 -0300

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.

Diffstat:
Mlvm.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lvm.c b/lvm.c @@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.357 2018/06/01 16:51:34 roberto Exp roberto $ +** $Id: lvm.c,v 2.358 2018/06/15 14:14:20 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -712,7 +712,7 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); else /* get upvalue from enclosing function */ ncl->upvals[i] = encup[uv[i].idx]; - /* new closure is white, so we do not need a barrier here */ + luaC_objbarrier(L, ncl, ncl->upvals[i]); } if (p->cachemiss >= MAXMISS) /* too many missings? */ p->cache = NULL; /* give up cache */ @@ -1790,7 +1790,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { } vmcase(OP_VARARG) { int n = GETARG_C(i) - 1; /* required results */ - ProtectNT(luaT_getvarargs(L, ci, ra, n)); + Protect(luaT_getvarargs(L, ci, ra, n)); vmbreak; } vmcase(OP_PREPVARARG) {