diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-22 16:24:46 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-22 16:24:46 +1000 |
commit | 13ba814ab51f43718c1f07680012e6ee7815b16b (patch) | |
tree | 68e1e3fe1a00d5b0235b7aa0d543cc14506d3367 /src/lvm.js | |
parent | edf9e47120f2098458519628335a7e90b2569b70 (diff) | |
download | fengari-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.js | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |