[Soot-list] Why JSubExpr if Jimple does not have subexpression?

Z zell08v at orange.fr
Fri Jul 6 01:32:22 EDT 2012


Thanks Eric.

In the following, I show 2 different versions of jimple files generated
within my Eclipse. They are output to the same sootOutput directory, with
the same file name "tester.Snippet.Jimple" . But the 2nd one seems to
transform each SubExpr "x-1" to AddExpr "x+ -1" . Am I doing something
wrong here? Thank you for your help.

Zell.

---------My original test4() method in tester.Snippet.java is------------
    static void test4() {
        int y;
        y = 7;
        y = y+1;
        y= y-1;
    }

-------This  following one is generated by right-clicking the java source,
then SOOT->process SOOT File->create Jimple ---------------
    static void test4()
    {
        int y, temp$0, temp$1, temp$2, temp$3;

        temp$0 = 7;
        y = temp$0;
        temp$1 = y;
        temp$2 = temp$1 + 1;
        y = temp$2;
        temp$3 = y - 1;
        y = temp$3;
        return;
    }

---------------This following  one is launched by this  main() in Java:
" ...main(String[] args) {  args="-f J tester.Snippet".split(" "); ...
soot.Main.main(args);}" -------------

    static void test4()
    {
        byte b0;
        int i1, i2;

        b0 = 7;
        i1 = b0 + 1;
        i2 = i1 + -1;
        return;
    }

On Wed, Jul 4, 2012 at 10:34 AM, Eric Bodden <eric.bodden at ec-spride.de>wrote:

> > Apparently, Jimple transforms all the expressions like "x = y - 7 " to "
> z =
> > y +  (-7)",
>
> I don't think it does - at least not if you process bytecode.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20120706/4db6f569/attachment.html 


More information about the Soot-list mailing list