From e34f282365d72ddbd2000f789cd804dbbd433773 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 24 Jun 2002 10:08:45 -0300 Subject: `luaV_gettable' returns element position --- lapi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index f4f56602..b0f3e52b 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 1.200 2002/06/18 15:19:27 roberto Exp roberto $ +** $Id: lapi.c,v 1.201 2002/06/20 20:41:46 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -423,9 +423,11 @@ LUA_API void lua_pushudataval (lua_State *L, void *p) { LUA_API void lua_gettable (lua_State *L, int index) { StkId t; + const TObject *v; lua_lock(L); t = luaA_index(L, index); - luaV_gettable(L, t, L->top-1, L->top-1); + v = luaV_gettable(L, t, L->top-1); + setobj(L->top - 1, v); lua_unlock(L); } -- cgit v1.2.3-55-g6feb