aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-07 17:26:15 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-07 17:26:15 -0300
commit37c215b43f27a1c41e8a920987e1c3bd7b34330d (patch)
treef14f4417384cffb9d2e5ef3c09621555a5d1e9a2 /lstate.c
parent9e99f3071d07767f9e882c4abf3537f75ce2d161 (diff)
parentfa075b79530af1cbc977349f2e467d69ce01202c (diff)
downloadlua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.gz
lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.bz2
lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.zip
Merge branch 'newarray' into nextversion
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lstate.c b/lstate.c
index 6f4c7e28..c01e53ed 100644
--- a/lstate.c
+++ b/lstate.c
@@ -184,13 +184,16 @@ static void freestack (lua_State *L) {
184*/ 184*/
185static void init_registry (lua_State *L, global_State *g) { 185static void init_registry (lua_State *L, global_State *g) {
186 /* create registry */ 186 /* create registry */
187 TValue aux;
187 Table *registry = luaH_new(L); 188 Table *registry = luaH_new(L);
188 sethvalue(L, &g->l_registry, registry); 189 sethvalue(L, &g->l_registry, registry);
189 luaH_resize(L, registry, LUA_RIDX_LAST, 0); 190 luaH_resize(L, registry, LUA_RIDX_LAST, 0);
190 /* registry[LUA_RIDX_MAINTHREAD] = L */ 191 /* registry[LUA_RIDX_MAINTHREAD] = L */
191 setthvalue(L, &registry->array[LUA_RIDX_MAINTHREAD - 1], L); 192 setthvalue(L, &aux, L);
193 luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &aux);
192 /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */ 194 /* registry[LUA_RIDX_GLOBALS] = new table (table of globals) */
193 sethvalue(L, &registry->array[LUA_RIDX_GLOBALS - 1], luaH_new(L)); 195 sethvalue(L, &aux, luaH_new(L));
196 luaH_setint(L, registry, LUA_RIDX_GLOBALS, &aux);
194} 197}
195 198
196 199