aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 11:54:57 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-02 11:54:57 +0100
commit57de149902761c4ed5d9c199fd0818aad781bde3 (patch)
tree61fcda8980b66be200e66b021d3b8416233c389f /src
parentaee0f65dea0456635e96b4496f6597188526e647 (diff)
downloadfengari-57de149902761c4ed5d9c199fd0818aad781bde3.tar.gz
fengari-57de149902761c4ed5d9c199fd0818aad781bde3.tar.bz2
fengari-57de149902761c4ed5d9c199fd0818aad781bde3.zip
[Parsing tests] SELF
Diffstat (limited to 'src')
-rw-r--r--src/lcode.js2
1 files changed, 1 insertions, 1 deletions
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 */