[Soot-list] odd soot behaviour - decompilation question

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Tue Jan 31 18:59:42 EST 2006


Hello folks,

I have a quick question. I'm trying to rename local variables with a
BodyTransformer in jimple (called LocalsRenamer). I have my own main
method which adds the pack as follows:

Pack jtp = PackManager.v().getPack("jtp");
jtp.add(new Transform("jtp.jcbolr", new LocalsRenamer()));

The local variables are renamed without a problem. I am, however, getting
some type issues, the following of which is an example:

int method(float flt)
{
  if(flt < 1.5f) return 0;

  return 1;
}

When I run this transformation and output class files the program runs
fine. If I take the output class files and re-run (normal) soot on them,
asking for dava .java output, the output java files recompile fine.
However, if I run the transformation _and_ output dava .java all in one
run of soot, I get the following output for 'method':

int method(float x)
{
  byte y;

  y = x - 1.5F;

  if (y >= (byte) 0) return 1;

  return 0;
}

And the subsequent problem trying to re-compile:

possible loss of precision
found   : float
required: byte
        y = x - 1.5F;

Does anyone have any idea what may be happening?

Thanks a bunch,

Michael Batchelder



More information about the Soot-list mailing list