From 22dd271cbba22c0765eb45296a957ecacf68755e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 19 Dec 2001 16:11:00 -0200 Subject: another bug in next (when n is a power of 2) --- ltable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltable.c') diff --git a/ltable.c b/ltable.c index ac721f41..9485a527 100644 --- a/ltable.c +++ b/ltable.c @@ -1,5 +1,5 @@ /* -** $Id: ltable.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ +** $Id: ltable.c,v 1.93 2001/12/11 22:48:44 roberto Exp roberto $ ** Lua tables (hash) ** See Copyright Notice in lua.h */ @@ -97,7 +97,7 @@ int luaH_index (lua_State *L, Table *t, const TObject *key) { int i; if (ttype(key) == LUA_TNIL) return -1; /* first iteration */ i = arrayindex(key); - if (0 <= i && i < t->sizearray) { /* is `key' inside array part? */ + if (0 <= i && i <= t->sizearray) { /* is `key' inside array part? */ return i-1; /* yes; that's the index (corrected to C) */ } else { -- cgit v1.2.3-55-g6feb