diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-05-10 15:03:12 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-05-10 15:03:12 +0200 |
commit | b4e21e155a1fc3f0b46439859332c408e65ec67d (patch) | |
tree | 92f214fd59e94f1bbfa23e8dd99a781827442222 /src/lvm.js | |
parent | bb7bd48b2ee90472a1353f996b355559f78a197a (diff) | |
download | fengari-b4e21e155a1fc3f0b46439859332c408e65ec67d.tar.gz fengari-b4e21e155a1fc3f0b46439859332c408e65ec67d.tar.bz2 fengari-b4e21e155a1fc3f0b46439859332c408e65ec67d.zip |
Don't do recursive call of luaV_tointeger if luaO_str2num returns false
Diffstat (limited to 'src/lvm.js')
-rw-r--r-- | src/lvm.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -845,7 +845,8 @@ const luaV_tointeger = function(obj, mode) { } else if (obj.ttisinteger()) { return obj.value; } else if (obj.ttisstring()) { - return luaV_tointeger(lobject.luaO_str2num(obj.svalue()), mode); + let n = lobject.luaO_str2num(obj.svalue()); + return n !== false ? luaV_tointeger(n, mode) : false; } return false; |