luadec
luadec copied to clipboard
a bug in lua5.3
test.lua: local arry={1,2,3} function check(idx) return arry[idx] or arry[#arry] end
cmd: luac test.lua luadec luac.out>res.lua
res.lua: -- Decompiled using luadec 2.2 rev: $WCREV$ for Lua 5.3 from https://github.com/viruscamp/luadec -- Command line: luac.out
-- params : ... -- function num : 0 , upvalues : _ENV local arry = {1, 2, 3} check = function(idx) -- function num : 0_0 , upvalues : arry if not arry[idx] then return arry[#arry] end end
Seems like a similar thing to https://github.com/viruscamp/luadec/issues/75 is going on here. So also see the section "Status" in https://github.com/sztupy/luadec51/blob/master/README.markdown
And as with #75 this problem is fixed in unluac