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

Re: Naming of Jimple Locals



> 
> >
> >   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)?