aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-22 13:32:50 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-12-22 13:32:50 -0200
commitf84b575cfa52dc832751846aa0b4c8ff437d3ca3 (patch)
tree246ef484b08d132d006c16a6c8cbe55e61c3bfce /ltests.c
parent3cb343efd644fb771b6d8193406afd49527dc1ec (diff)
downloadlua-f84b575cfa52dc832751846aa0b4c8ff437d3ca3.tar.gz
lua-f84b575cfa52dc832751846aa0b4c8ff437d3ca3.tar.bz2
lua-f84b575cfa52dc832751846aa0b4c8ff437d3ca3.zip
no more pseudoindex LUA_GLOBALSINDEX; global table now accessible
through registry
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ltests.c b/ltests.c
index 57493695..01edb955 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 2.84 2009/12/16 16:42:58 roberto Exp roberto $ 2** $Id: ltests.c,v 2.85 2009/12/17 16:20:01 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -376,7 +376,7 @@ int lua_checkmemory (lua_State *L) {
376 GCObject *o; 376 GCObject *o;
377 UpVal *uv; 377 UpVal *uv;
378 checkliveness(g, &g->l_registry); 378 checkliveness(g, &g->l_registry);
379 checkliveness(g, &g->l_gt); 379 lua_assert(!isdead(g, obj2gco(g->l_gt)));
380 checkstack(g, g->mainthread); 380 checkstack(g, g->mainthread);
381 for (o = g->rootgc; o != obj2gco(g->mainthread); o = gch(o)->next) { 381 for (o = g->rootgc; o != obj2gco(g->mainthread); o = gch(o)->next) {
382 lua_assert(!testbits(o->gch.marked, bit2mask(SEPARATED, SFIXEDBIT))); 382 lua_assert(!testbits(o->gch.marked, bit2mask(SEPARATED, SFIXEDBIT)));
@@ -767,7 +767,7 @@ static int loadlib (lua_State *L) {
767 {NULL, NULL} 767 {NULL, NULL}
768 }; 768 };
769 lua_State *L1 = getstate(L); 769 lua_State *L1 = getstate(L);
770 lua_pushvalue(L1, LUA_GLOBALSINDEX); 770 lua_pushglobaltable(L1);
771 luaL_register(L1, NULL, libs); 771 luaL_register(L1, NULL, libs);
772 return 0; 772 return 0;
773} 773}
@@ -878,7 +878,7 @@ static int getindex_aux (lua_State *L, lua_State *L1, const char **pc) {
878 skip(pc); 878 skip(pc);
879 switch (*(*pc)++) { 879 switch (*(*pc)++) {
880 case 'R': return LUA_REGISTRYINDEX; 880 case 'R': return LUA_REGISTRYINDEX;
881 case 'G': return LUA_GLOBALSINDEX; 881 case 'G': return luaL_error(L, "deprecated index 'G'");
882 case 'E': return LUA_ENVIRONINDEX; 882 case 'E': return LUA_ENVIRONINDEX;
883 case 'U': return lua_upvalueindex(getnum_aux(L, L1, pc)); 883 case 'U': return lua_upvalueindex(getnum_aux(L, L1, pc));
884 default: (*pc)--; return getnum_aux(L, L1, pc); 884 default: (*pc)--; return getnum_aux(L, L1, pc);