commit 22dd271cbba22c0765eb45296a957ecacf68755e
parent e04f7ed4509af1577c10ead8e5d7d55c65754bf8
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 19 Dec 2001 16:10:38 -0200
another bug in next (when n is a power of 2)
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git 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 {