luadec icon indicating copy to clipboard operation
luadec copied to clipboard

a bug in lua5.3

Open QSlash opened this issue 7 years ago • 1 comments

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

QSlash avatar Apr 10 '17 10:04 QSlash

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

rocky avatar Mar 11 '22 20:03 rocky