From b52cef979b2582df1ec1d2117919b63a3a995f29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhang=C2=A0bin?= Date: Fri, 22 Feb 2019 10:06:37 +0800 Subject: [PATCH] Fix lua_next index error bug --- lua.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua.c b/lua.c index c532e52..72202ba 100755 --- a/lua.c +++ b/lua.c @@ -322,7 +322,7 @@ zval *php_lua_get_zval_from_lua(lua_State *L, int index, zval *lua_obj, zval *rv case LUA_TTABLE: array_init(rv); lua_pushnil(L); /* first key */ - while (lua_next(L, index-1) != 0) { + while (lua_next(L, index) != 0) { zval key, val; /* uses 'key' (at index -2) and 'value' (at index -1) */