purescript-lua-integers issues are disabled, so filing here.
In src/Data/Int.lua, toStringAs assigns to n without declaring it local:
toStringAs = (function(radix)
return function(i)
local floor, insert = math.floor, table.insert
n = floor(i) -- writes the global `n`
...
Every call clobbers the global n in the Lua environment. It works by accident in isolation, but it is a hidden write to shared state that can corrupt an unrelated n (or be corrupted by one in a reentrant call). The fix is a one-word local n = floor(i).
Low severity, but worth a release since it is a latent correctness trap. Found while auditing the FFI forks for Lua 5.1 issues.
purescript-lua-integersissues are disabled, so filing here.In
src/Data/Int.lua,toStringAsassigns tonwithout declaring itlocal:Every call clobbers the global
nin the Lua environment. It works by accident in isolation, but it is a hidden write to shared state that can corrupt an unrelatedn(or be corrupted by one in a reentrant call). The fix is a one-wordlocal n = floor(i).Low severity, but worth a release since it is a latent correctness trap. Found while auditing the FFI forks for Lua 5.1 issues.