[Soot-list] problem by labeling i soot

Eric Bodden eric.bodden at mail.mcgill.ca
Mon Jun 25 17:15:55 EDT 2007


So what's the problem?

Eric

On 25/06/07, Shahpoor Rahmani <sh_raha at yahoo.com> wrote:
> Hi Everybody,
>
> we working on analyzing java source code by soot.
>
> our sample code is:
>
> public class Main
> {
> void main() {
> int n;
> n = 5;
> int i;
> i = 1;
> int j;
> int sum;
> sum = 0;
> while (i <= n){
> sum = 0;
> j = 1;
> while (j <= i){
> sum = sum + j;
> j = j + 1;
> }
> System.out.print(sum + i);
> i = i + 1;
> }
> System.out.print(sum + i);
> }
>
> }
>
> a simple java program for testing and analyzing method.
> in dominate and post-dominate phase when we use of soot it create a jimple
> body as :
>
> r0 := @this: Main
> i0 = 5
> i1 = 1
> i2 = 0
> if i1 > i0 goto $r2 = <java.lang.System: java.io.PrintStream out>
> i2 = 0
> i3 = 1
> if i3 > i1 goto $r1 = <java.lang.System: java.io.PrintStream out>
> i2 = i2 + i3
> i3 = i3 + 1
> goto [?= (branch)]
> $r1 = <java.lang.System: java.io.PrintStream out>
> $i4 = i2 + i1
> virtualinvoke $r1.<java.io.PrintStream: void print(int)>($i4)
> i1 = i1 + 1
> goto [?= (branch)]
> $r2 = <java.lang.System: java.io.PrintStream out>
> $i5 = i2 + i1
> virtualinvoke $r2.<java.io.PrintStream: void print(int)>($i5)
> return
>
> ------------------------------------------------------------------------------------
> if you look at goto statement that you find same line code without goto
> label. and it cause problem to create Dominate Graph. i attached CFG and
> Post-dominate Graph by this mail, please check it and help me.
>
> Yours,
>
> Shahpoor
>
>  ________________________________
> Be a better Globetrotter. Get better travel answers from someone who knows.
> Yahoo! Answers - Check it out.
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list