diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-01-13 13:56:03 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-01-13 13:56:03 -0200 |
| commit | 46ec57cbc6dfe8df707be8f1fa52146988013feb (patch) | |
| tree | 9d5a08bbcc0c515f80475f30f3a6e4f933df0dd4 /lapi.c | |
| parent | 62787f1b1f9bb745afbf28b04241c9020a74b7a2 (diff) | |
| download | lua-46ec57cbc6dfe8df707be8f1fa52146988013feb.tar.gz lua-46ec57cbc6dfe8df707be8f1fa52146988013feb.tar.bz2 lua-46ec57cbc6dfe8df707be8f1fa52146988013feb.zip | |
little change when calling tag methods
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 1.66 1999/12/27 17:33:22 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.67 1999/12/30 18:27:03 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -157,6 +157,7 @@ lua_Object lua_rawgettable (lua_State *L) { | |||
| 157 | 157 | ||
| 158 | void lua_settable (lua_State *L) { | 158 | void lua_settable (lua_State *L) { |
| 159 | luaA_checkCparams(L, 3); | 159 | luaA_checkCparams(L, 3); |
| 160 | luaD_checkstack(L, 3); /* may need that to call a tag method */ | ||
| 160 | luaV_settable(L, L->top-3); | 161 | luaV_settable(L, L->top-3); |
| 161 | L->top -= 2; /* pop table and index */ | 162 | L->top -= 2; /* pop table and index */ |
| 162 | } | 163 | } |
| @@ -178,7 +179,7 @@ lua_Object lua_createtable (lua_State *L) { | |||
| 178 | 179 | ||
| 179 | 180 | ||
| 180 | lua_Object lua_getglobal (lua_State *L, const char *name) { | 181 | lua_Object lua_getglobal (lua_State *L, const char *name) { |
| 181 | luaD_checkstack(L, 2); /* may need that to call a tag method */ | 182 | luaD_checkstack(L, 3); /* may need that to call a tag method */ |
| 182 | luaV_getglobal(L, luaS_assertglobalbyname(L, name)); | 183 | luaV_getglobal(L, luaS_assertglobalbyname(L, name)); |
| 183 | return luaA_putObjectOnTop(L); | 184 | return luaA_putObjectOnTop(L); |
| 184 | } | 185 | } |
| @@ -192,7 +193,7 @@ lua_Object lua_rawgetglobal (lua_State *L, const char *name) { | |||
| 192 | 193 | ||
| 193 | void lua_setglobal (lua_State *L, const char *name) { | 194 | void lua_setglobal (lua_State *L, const char *name) { |
| 194 | luaA_checkCparams(L, 1); | 195 | luaA_checkCparams(L, 1); |
| 195 | luaD_checkstack(L, 2); /* may need that to call a tag method */ | 196 | luaD_checkstack(L, 3); /* may need that to call a tag method */ |
| 196 | luaV_setglobal(L, luaS_assertglobalbyname(L, name)); | 197 | luaV_setglobal(L, luaS_assertglobalbyname(L, name)); |
| 197 | } | 198 | } |
| 198 | 199 | ||
