[Soot-list] Why JSubExpr if Jimple does not have subexpression?
Eric Bodden
eric.bodden at ec-spride.de
Fri Jul 6 03:29:24 EDT 2012
Hmmm, interesting. Maybe the compiler just compiles the code that way
(for whatever reason). I would be surprised if Soot actually did this
conversion. Anyway - does it hurt?
Eric
On 6 July 2012 07:32, Z <zell08v at orange.fr> wrote:
> 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.
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
--
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
More information about the Soot-list
mailing list