diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-24 10:08:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-24 10:08:45 -0300 |
commit | e34f282365d72ddbd2000f789cd804dbbd433773 (patch) | |
tree | 9071862c6c42fb2020830da5876f112f4f8f6931 /lapi.c | |
parent | 3941af53adee868e2cccfb9b85783aba9ac311c1 (diff) | |
download | lua-e34f282365d72ddbd2000f789cd804dbbd433773.tar.gz lua-e34f282365d72ddbd2000f789cd804dbbd433773.tar.bz2 lua-e34f282365d72ddbd2000f789cd804dbbd433773.zip |
`luaV_gettable' returns element position
Diffstat (limited to 'lapi.c')
-rw-r--r-- | lapi.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 1.200 2002/06/18 15:19:27 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 1.201 2002/06/20 20:41:46 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 | */ |
@@ -423,9 +423,11 @@ LUA_API void lua_pushudataval (lua_State *L, void *p) { | |||
423 | 423 | ||
424 | LUA_API void lua_gettable (lua_State *L, int index) { | 424 | LUA_API void lua_gettable (lua_State *L, int index) { |
425 | StkId t; | 425 | StkId t; |
426 | const TObject *v; | ||
426 | lua_lock(L); | 427 | lua_lock(L); |
427 | t = luaA_index(L, index); | 428 | t = luaA_index(L, index); |
428 | luaV_gettable(L, t, L->top-1, L->top-1); | 429 | v = luaV_gettable(L, t, L->top-1); |
430 | setobj(L->top - 1, v); | ||
429 | lua_unlock(L); | 431 | lua_unlock(L); |
430 | } | 432 | } |
431 | 433 | ||