first key can't can be in hash part, see #1484

This commit is contained in:
Cloud Wu
2022-11-21 19:26:16 +08:00
parent 98311b9b91
commit 58b1bda0d9

View File

@@ -519,7 +519,10 @@ is_rawarray(lua_State *L) {
}
lua_Integer firstkey = lua_isinteger(L, -2) ? lua_tointeger(L, -2) : 0;
lua_pop(L, 2);
return firstkey > 0;
if (firstkey <= 1) {
return firstkey > 0;
}
return firstkey <= lua_rawlen(L, -1);
}
static void