diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-07 17:26:15 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-07 17:26:15 -0300 |
commit | 37c215b43f27a1c41e8a920987e1c3bd7b34330d (patch) | |
tree | f14f4417384cffb9d2e5ef3c09621555a5d1e9a2 /lstate.c | |
parent | 9e99f3071d07767f9e882c4abf3537f75ce2d161 (diff) | |
parent | fa075b79530af1cbc977349f2e467d69ce01202c (diff) | |
download | lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.gz lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.tar.bz2 lua-37c215b43f27a1c41e8a920987e1c3bd7b34330d.zip |
Merge branch 'newarray' into nextversion
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -184,13 +184,16 @@ static void freestack (lua_State *L) { | |||
184 | */ | 184 | */ |
185 | static void init_registry (lua_State *L, global_State *g) { | 185 | static 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, ®istry->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, ®istry->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 | ||