[Soot-list] Original local variables VS. JimpleLocals after the "-src-prec java" option is used?

Sunny sunfire001 at gmail.com
Wed May 17 22:58:49 EDT 2006


Hi,

Could someone answer a few of my questions please?

1. If I use the "-src-prec java" option, the translated Jimple code keeps
the original local variable names. Then, does this mean Soot creates exactly
one JimpleLocal object for each local variable in the original code ( i.e.,
does each JimpleLocal object corresponds to exactly one original local
variable)? For instance, if the original code is:

public void test()
{
   {
      Object a;
      a = new String("abc");
      a = new String("def");
   }
   {
      Object a;

      a = new String("pqr");
      a = new String("xyz");
   }
}

In the above code, although the two different local variables have the same
name 'a', I would expect two different JimpleLocal objects in the translated
Jimple code. Is this right?

2. What does the method Numberable#getNumber() mean?

3. In the class JimpleLocal, the equivHashCode() says: "Returns a hash code
for this object, consistent with structural equality". It seems to me that
x.equivHashCode() == y.equivHashCode() implies x.equivTo (y). But after I
compiled the above code into Jimple and run the BodyTransformer, I got two
JimpleLocal objects which have the same equivHashCode but which are not
equivalent (i.e., x.equivTo(y)). Why is this?

4. If x and y are Local Objects, x == y iff x.equivTo(y) returns true,
correct?

Many thanks in advance!

Sunny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060517/52e0940f/attachment.htm


More information about the Soot-list mailing list