Hello.
Conversion from lua table to java map use wrong index to call C.lua_next(L, -2)
in AbstractLua.java line 384 C.lua_next(L, -2) is missing index, one solution is
/ Use positive index or values under LUA_REGISTRYINDEX(-10000), or decrement negative index /
C.lua_next(L, ((index > 0) || (index < -9999))? index : (index -1))
or the other solution is to pushValue(index) when stack is at the same state and re pushValue(...) for the lua_next call.
Otherwise it's work pretty well, cool project, thanks for the hard work.
To Reproduce
L.createTable(0, 2);
L.push("AA");
L.setField(-2, "A");
L.pushNil(); / dumb value to fill the stack /
Map<?, ?> map = L.toMap(-2); / will crash /
assert(!map.isEmpty()); / will fail /
L.pop(2)
Hello. Conversion from lua table to java map use wrong index to call C.lua_next(L, -2) in AbstractLua.java line 384 C.lua_next(L, -2) is missing index, one solution is / Use positive index or values under LUA_REGISTRYINDEX(-10000), or decrement negative index / C.lua_next(L, ((index > 0) || (index < -9999))? index : (index -1))
or the other solution is to pushValue(index) when stack is at the same state and re pushValue(...) for the lua_next call.
Otherwise it's work pretty well, cool project, thanks for the hard work.
To Reproduce L.createTable(0, 2); L.push("AA"); L.setField(-2, "A"); L.pushNil(); / dumb value to fill the stack / Map<?, ?> map = L.toMap(-2); / will crash / assert(!map.isEmpty()); / will fail / L.pop(2)
Platform: