Deny use NaN as index in rawset.

This commit is contained in:
Enyby
2018-12-24 22:34:49 +02:00
committed by GitHub
parent cfb3aaca61
commit c2ec9edf39

View File

@@ -299,7 +299,8 @@ public class BaseLib extends TwoArgFunction implements ResourceFinder {
} }
public LuaValue call(LuaValue table, LuaValue index, LuaValue value) { public LuaValue call(LuaValue table, LuaValue index, LuaValue value) {
LuaTable t = table.checktable(); LuaTable t = table.checktable();
t.rawset(index.checknotnil(), value); if (!index.isvalidkey()) argerror(2, "value");
t.rawset(index, value);
return t; return t;
} }
} }