lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On this day of 03/10/2008 04:13 AM, Rob Kendrick saw fit to scribe:
> On Mon, 2008-03-10 at 12:50 +0200, Asko Kauppi wrote:
>> If someone really wants to do this; to replace local names by, say,  
>> 'a0', 'a1', and so on, it is not at all difficult.
> The difficult part comes in selecting variable names that do not clash
> with any globals the program may create and access at runtime.  I'm not
> entirely sure the problem is solvable.

Well, even without going into theory like:
if thisProgramHalts() then useSomeVariable end
or more practical things like:
if runSomeLoop() then useSomeVariable end

you have problems like variable names derived from user input.

I think you could get around this with some conservative approximations;
you can assume that any variable that appears in the program will always
be used (that gets around the halting-problem situation); and you can
assume that if a name may be constructed by 'tainted' (i.e. input)
variables, it is not safe to run the local-variable-shrinker tool on the
program. (Of course, "not safe" in the conservative sense.) I suspect
that the second problem (determining 'taintedness') is quite a bit
harder than the first...

- David