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

Assignment statement isn't parsing



When I run soot with the command line below on the classes generated 
with the source code below, I do not get the right results.

Command line:
	java soot.Main -j --soot-classpath .:$JAVA_HOME/jre/lib/rt.jar -p jb 
use-original-names A
(The problem is independent of whether I use the phase option to keep 
the original names, but the results are easier to read with it.)

Source code:

public class A {
   void run() {
     int e = 0;
     e =  calc();
   }

   static int calc() {
     return 0;
   }
}

Here is the bad result, A.jimp:

public class A extends java.lang.Object
{
     void run()
     {
         A r0;
         boolean z0;

         r0 := @this;
         z0 = 0;
         A.calc();
         return;
     }

     public void <init>()
     {
         A r0;

         r0 := @this;
         specialinvoke r0.<init>();
         return;
     }
}

The line "A.calc();" should be "z0 = A.calc();".
However, if I make e into a double, so that the value from calc() has to 
be cast, I get what I should: "$d0 = A.calc(); z0 = (int) $d0;".

Does someone know how to fix this?

-- 
Nathan Kitchen
kitchen@et.byu.edu