aboutsummaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-09-25 11:48:42 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-09-25 11:48:42 -0300
commitc2aa7bd72d620731b5a54b532523dbd9f8e1bfc3 (patch)
treeb95f235c517d499fc50b1a6c9061928f496e37de /lvm.c
parentf9dd50cefc6c1c2c57f24d9985c1cc073d9d7300 (diff)
downloadlua-c2aa7bd72d620731b5a54b532523dbd9f8e1bfc3.tar.gz
lua-c2aa7bd72d620731b5a54b532523dbd9f8e1bfc3.tar.bz2
lua-c2aa7bd72d620731b5a54b532523dbd9f8e1bfc3.zip
bug: lua_gettable does not get key from stack top
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lvm.c b/lvm.c
index 22ff9ae7..365fb42d 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.135 2000/09/11 17:38:42 roberto Exp roberto $ 2** $Id: lvm.c,v 1.136 2000/09/20 17:57:08 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*/
@@ -120,7 +120,7 @@ const TObject *luaV_gettable (lua_State *L, StkId t) {
120 ((tg = hvalue(t)->htag) == TAG_TABLE || /* with default tag? */ 120 ((tg = hvalue(t)->htag) == TAG_TABLE || /* with default tag? */
121 ttype(luaT_getim(L, tg, IM_GETTABLE)) == TAG_NIL)) { /* or no TM? */ 121 ttype(luaT_getim(L, tg, IM_GETTABLE)) == TAG_NIL)) { /* or no TM? */
122 /* do a primitive get */ 122 /* do a primitive get */
123 const TObject *h = luaH_get(L, hvalue(t), t+1); 123 const TObject *h = luaH_get(L, hvalue(t), L->top-1);
124 /* result is no nil or there is no `index' tag method? */ 124 /* result is no nil or there is no `index' tag method? */
125 if (ttype(h) != TAG_NIL || 125 if (ttype(h) != TAG_NIL ||
126 (ttype(im=luaT_getim(L, tg, IM_INDEX)) == TAG_NIL)) 126 (ttype(im=luaT_getim(L, tg, IM_INDEX)) == TAG_NIL))