diff options
Diffstat (limited to 'lvm.c')
| -rw-r--r-- | lvm.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 1.195 2001/10/02 16:45:03 roberto Exp $ | 2 | ** $Id: lvm.c,v 1.196 2001/10/25 19:14:14 roberto Exp roberto $ |
| 3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -176,7 +176,7 @@ void luaV_settable (lua_State *L, StkId t, TObject *key, StkId val) { | |||
| 176 | 176 | ||
| 177 | 177 | ||
| 178 | void luaV_getglobal (lua_State *L, TString *name, StkId res) { | 178 | void luaV_getglobal (lua_State *L, TString *name, StkId res) { |
| 179 | const TObject *value = luaH_getstr(L->gt, name); | 179 | const TObject *value = luaH_getstr(hvalue(&L->gt), name); |
| 180 | Closure *tm; | 180 | Closure *tm; |
| 181 | if (!HAS_TM_GETGLOBAL(L, ttype(value)) || /* is there a tag method? */ | 181 | if (!HAS_TM_GETGLOBAL(L, ttype(value)) || /* is there a tag method? */ |
| 182 | (tm = luaT_gettmbyObj(G(L), value, TM_GETGLOBAL)) == NULL) { | 182 | (tm = luaT_gettmbyObj(G(L), value, TM_GETGLOBAL)) == NULL) { |
| @@ -188,12 +188,12 @@ void luaV_getglobal (lua_State *L, TString *name, StkId res) { | |||
| 188 | 188 | ||
| 189 | 189 | ||
| 190 | void luaV_setglobal (lua_State *L, TString *name, StkId val) { | 190 | void luaV_setglobal (lua_State *L, TString *name, StkId val) { |
| 191 | const TObject *oldvalue = luaH_getstr(L->gt, name); | 191 | const TObject *oldvalue = luaH_getstr(hvalue(&L->gt), name); |
| 192 | Closure *tm; | 192 | Closure *tm; |
| 193 | if (!HAS_TM_SETGLOBAL(L, ttype(oldvalue)) || /* no tag methods? */ | 193 | if (!HAS_TM_SETGLOBAL(L, ttype(oldvalue)) || /* no tag methods? */ |
| 194 | (tm = luaT_gettmbyObj(G(L), oldvalue, TM_SETGLOBAL)) == NULL) { | 194 | (tm = luaT_gettmbyObj(G(L), oldvalue, TM_SETGLOBAL)) == NULL) { |
| 195 | if (oldvalue == &luaO_nilobject) | 195 | if (oldvalue == &luaO_nilobject) |
| 196 | luaH_setstr(L, L->gt, name, val); /* raw set */ | 196 | luaH_setstr(L, hvalue(&L->gt), name, val); /* raw set */ |
| 197 | else | 197 | else |
| 198 | settableval(oldvalue, val); /* warning: tricky optimization! */ | 198 | settableval(oldvalue, val); /* warning: tricky optimization! */ |
| 199 | } | 199 | } |
