[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Bug: loadstring() code validator sometimes incorrectly flags chunks as bad
- From: "Greg Falcon" <veloso@...>
- Date: Wed, 26 Mar 2008 18:37:41 -0400
If you have a table constructor of the right size, the integer stored
in the opcode slot following a SETLIST (C=0) can look like another
SETLIST (C=0). The code checker will complain about legitimate jumps
to the instruction immediately following this integer.
Example:
> z={}
> for i=1,27290 do z[i]='1,' end
> z = 'if 1+1==2 then local a={' .. table.concat(z) .. '} end'
> func = loadstring(z)
> =func
function: 0x3092c0
> =loadstring(string.dump(func))
nil binary string: bad code in precompiled chunk
Greg F