From 57de149902761c4ed5d9c199fd0818aad781bde3 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Thu, 2 Mar 2017 11:54:57 +0100 Subject: [Parsing tests] SELF --- src/lcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lcode.js') diff --git a/src/lcode.js b/src/lcode.js index 9380d1a..9fb32e2 100644 --- a/src/lcode.js +++ b/src/lcode.js @@ -487,7 +487,7 @@ const addk = function(fs, key, v) { let idx = fs.ls.h.__index(fs.ls.h, key); /* index scanner table */ if (idx && !idx.ttisnil()) { /* is there an index there? */ /* correct value? (warning: must distinguish floats from integers!) */ - if (f.k[idx.value].ttype() === v.ttype() && f.k[idx.value].value === v.value) + if (idx.value < fs.nk && f.k[idx.value].ttype() === v.ttype() && f.k[idx.value].value === v.value) return idx.value; /* reuse index */ } /* constant not found; create a new entry */ -- cgit v1.2.3-54-g00ecf