lua-users home
lua-l archive

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


> > if not foo == "bar" then
> >
> > end
> I've seen a few "false positives" on this one...
In my case, I'm analyzing the bytecode and only flag it as a hit if 
the right hand side is a constant pool entry of a type other than 
boolean, which I think is a pretty solid assurance that the if body
will never execute because the types will mismatch.

It means I may miss some "bad" cases, but false positives haven't
come up so far.

> because our build includes a Lua macro processor, and sometimes 
> you end up with constructs like this only because the part after the 
> "not" is hidden inside a (perfectly valid) macro.
Interesting. Yeah, we don't use macros. I guess if we did I'd probably
have to analyze the bytecode after replacement.

DT