fix an issue that the first element of tuple array is stored at zero index of table on LuaJIT

This commit is contained in:
falsycat 2022-11-17 21:38:24 +09:00
parent 3c2ed1731a
commit eeb7dabd1f

View File

@ -61,7 +61,7 @@ void PushValue(lua_State* L, const nf7::Value& v) noexcept {
for (auto& p : tup) {
PushValue(L, p.second);
if (p.first.empty()) {
lua_rawseti(L, -2, static_cast<int>(arridx++));
lua_rawseti(L, -2, static_cast<int>(++arridx));
} else {
lua_setfield(L, -2, p.first.c_str());
}