lbi
lbi copied to clipboard
Inconsistency with actual lua (stack issue)
This repository hasn't been touched in ages but it is still useful so I would like to point something out to those who use it. The program:
local functions = {}
for i = 1, 10 do
functions[i] = function()
print(i)
end
end
functions[2]()
functions[9]()
real lua output:
2
9
lbi output:
10
10
I'm having trouble describing the problem with words so I hope the above example was enough for you to understand.
I would create a pull request if I knew how to fix this but the easiest work around for me was to use https://github.com/Rerumu/FiOne instead.
Thanks for the bug report.
I think it might be this code lol
[35] = function(instruction) -- CLOSE
io.stderr:write("NYI: CLOSE")
io.stderr:flush()
end,
But yea, looks like a pretty big problem with closures. I will try to fix this sometime in the next few days.