lua

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

commit 993c58fde3a85c27f52f094002ec57dabca81028
parent d49b2887282b86a5e6f40a386511aa8040f3c7b0
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon, 15 Jun 2020 12:01:09 -0300

In 'lua_checkmemory', userdata can be gray, too

Since commit ca6fe7449a74, userdata with uservalues can be gray
and can belong to gray lists ('gclist').

Diffstat:
Mltests.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/ltests.c b/ltests.c @@ -519,6 +519,10 @@ static void checkgraylist (global_State *g, GCObject *o) { case LUA_VCCL: o = gco2ccl(o)->gclist; break; case LUA_VTHREAD: o = gco2th(o)->gclist; break; case LUA_VPROTO: o = gco2p(o)->gclist; break; + case LUA_VUSERDATA: + lua_assert(gco2u(o)->nuvalue > 0); + o = gco2u(o)->gclist; + break; default: lua_assert(0); /* other objects cannot be in a gray list */ } }