aboutsummaryrefslogtreecommitdiff
path: root/lfunc.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 12:13:00 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-07-19 12:13:00 -0300
commit440a5ee78c8592230780310c9c8d8c2ba1700cb1 (patch)
tree30d361cbe23eb652f8874e580750ca65fcca5b52 /lfunc.h
parentdc07719b0dbc4f2df0f42e34e18be1e0ac4fa2c3 (diff)
downloadlua-440a5ee78c8592230780310c9c8d8c2ba1700cb1.tar.gz
lua-440a5ee78c8592230780310c9c8d8c2ba1700cb1.tar.bz2
lua-440a5ee78c8592230780310c9c8d8c2ba1700cb1.zip
Fixed bug for emergency collection in upvalue creation
When creating an upvalue, an emergency collection can collect the previous upvalue where the new one would be linked. The following code can trigger the bug, using valgrind on Lua compiled with the -DHARDMEMTESTS option: local x; local y (function () return y end)(); (function () return x end)()
Diffstat (limited to 'lfunc.h')
-rw-r--r--lfunc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lfunc.h b/lfunc.h
index 0ed79c48..72fc913a 100644
--- a/lfunc.h
+++ b/lfunc.h
@@ -57,7 +57,7 @@ LUAI_FUNC Proto *luaF_newproto (lua_State *L);
57LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); 57LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems);
58LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); 58LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems);
59LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); 59LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl);
60LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 60LUAI_FUNC void luaF_setupval (lua_State *L, StkId level, UpVal **slot);
61LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); 61LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level);
62LUAI_FUNC int luaF_close (lua_State *L, StkId level, int status); 62LUAI_FUNC int luaF_close (lua_State *L, StkId level, int status);
63LUAI_FUNC void luaF_unlinkupval (UpVal *uv); 63LUAI_FUNC void luaF_unlinkupval (UpVal *uv);