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

Strange Question



Hi, I have a strange question regarding the JimpleLocal.

The code is:
    public void testCase2(int input1, int input2,
                          int x1,
                          int x2,
                          int x3,
                          int x4,
                          int x5,
                          int x6,
                          int x7,
                          int x8,
                          int x9){

        x1 = input1 + 6;           //1

        if( x1 >= 10 ){            //2
            x2 = x1 + input2;      //3
            x3 = x1 + x2;          //4
            x4 = x2 * x3;          //5
            x5 = x3 & x4;          //6
        }
        else{
            x6 = input1 * 5;       //10
            x7 = input2 * input1;  //11
        }

        x8 = x5 + x4;              //7
        x9 = x8 & x1;              //8
        x8 = x9 + x4;              //9
    }


After changing into Jimple, the parameters are first changed into
JimpleLocal(i0, i1,........., i10). But in the body, some variables are
CHANGED into other JimpleLocals like i11, i12, and the worst thing is for
x8, it is different in the two lines, which is i16 and i18 !!

How can this happen? And how can I know if they are pointing to the same
parameter? Thanks!


Best Regards,

Welson Sun

-------------------------------------
Electrical and Computer Engineering
Brigham Young Unversity
461 CB, Provo, Utah 84602

Office: (801) 422-7206
Email:	welson@et.byu.edu
-------------------------------------