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

Re: Naming of Jimple Locals



As far as verifiers are concerned, you might want to take a look at BCEL 
(http://jakarta.apache.org/bcel/). I know it includes a verifier, although I 
haven't used it much. Since the source is available, you can always make it 
report as much details as you want if it does not do it by default.

	Bruno

On May 30, 2003 08:22 pm, Amit Manjhi wrote:
> > >   You can even (although this
> > >is a pretty bad idea!) give the same name to different locals, and Soot
> > >should handle it correctly.  But don't count on it!
> >
> > Actually, the naming business is nasty.  It works most of the time, but
> > some of the built-in
> > optimizations index by name, and then break.  (I seem to recall having
> > this difficulty with the ConstantPropagator, for instance.  Fortunately,
> > you can run the
> > LocalNameStandardizer by hand to fix the names.  It also doesn't work if
> > you write
> > to jimple and read back in, because jimple uses the string names for
> > locals.
>
> Initially, I was also under the impression that having a $ or not
> does not make any difference in Jimple code. But, while debugging
> recently, I found out that having a $ while naming a new local
> produced the expected result, while not having one did not. (I was
> writing to jimple, modifying the code by introducing a new local by
> hand, and using soot to read the jimple file back in and produce the
> actual class file.)
>
> Unfortunately, I am not able to reproduce the bug now :). If it later
> comes back to haunt me, I will ask for help.
>
> thanks,
> -amit
>
> P.S.: What tools/JVMs exist to verify a classfile that output the offending
> instruction, if the verification fails (or produce a more
> understandable error output)?