summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-22 16:24:46 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-22 16:24:46 +1000
commit13ba814ab51f43718c1f07680012e6ee7815b16b (patch)
tree68e1e3fe1a00d5b0235b7aa0d543cc14506d3367 /src/lvm.js
parentedf9e47120f2098458519628335a7e90b2569b70 (diff)
downloadfengari-13ba814ab51f43718c1f07680012e6ee7815b16b.tar.gz
fengari-13ba814ab51f43718c1f07680012e6ee7815b16b.tar.bz2
fengari-13ba814ab51f43718c1f07680012e6ee7815b16b.zip
Checks for nil and NaN table keys
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lvm.js b/src/lvm.js
index a5b10e0..6e1012c 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -1026,7 +1026,7 @@ const gettable = function(L, t, key, ra) {
ldebug.luaG_typeerror(L, t, defs.to_luastring('index', true)); /* no metamethod */
/* else will try the metamethod */
} else {
- let slot = ltable.luaH_get(t.value, key);
+ let slot = ltable.luaH_get(L, t.value, key);
if (!slot.ttisnil()) {
L.stack[ra] = new lobject.TValue(slot.type, slot.value);
return;
@@ -1054,10 +1054,10 @@ const settable = function(L, t, key, val) {
let tm;
if (t.ttistable()) {
let h = t.value; /* save 't' table */
- let slot = ltable.luaH_set(h, key);
+ let slot = ltable.luaH_set(L, h, key);
if (!slot.ttisnil() || (tm = ltm.fasttm(L, h.metatable, ltm.TMS.TM_NEWINDEX)) === null) {
if (val.ttisnil())
- ltable.luaH_delete(h, key);
+ ltable.luaH_delete(L, h, key);
else
slot.setfrom(val);
ltable.invalidateTMcache(h);