[Soot-list] one question about a mismatch between Jimple- and Java-representation
jiangfan shi
jiangfan.shi at gmail.com
Fri Aug 19 23:44:55 EDT 2011
>
>
> In any case, Soot is not going to let you really write to the parameter, so
> my guess is that it's going to change all subsequent accesses to "a" into
> accesses to a copy of "a".
>
>
I just confirmed this with a changed code shown below:
==========Java===========
void Method1(TestcaseForSoot2_discussion1 a,TestcaseForSoot2_discussion1 b){
TestcaseForSoot2_discussion1 x=new TestcaseForSoot2_discussion1();
x.myint=5;
a=x;
a.myint=6;
}
=========Jimple=============
void Method1(TestcaseForSoot2_discussion1, TestcaseForSoot2_discussion1)
{
TestcaseForSoot2_discussion1 r0, r1, r2, $r3, r4, r5;
r0 := @this: TestcaseForSoot2_discussion1;
r1 := @parameter0: TestcaseForSoot2_discussion1;
r2 := @parameter1: TestcaseForSoot2_discussion1;
$r3 = new TestcaseForSoot2_discussion1;
specialinvoke $r3.<TestcaseForSoot2_discussion1: void <init>()>();
r4 = $r3;
r4.<TestcaseForSoot2_discussion1: int myint> = 5;
r5 = r4;
r5.<TestcaseForSoot2_discussion1: int myint> = 6;
return;
}
So we can see r5 is continued to be used in the assignment statement "
r5.<TestcaseForSoot2_discussion1:
int myint> = 6;" in Jimple.
But I am still thinking such translation is not consistent between Java and
Jimple unless there is a fixed and implicit rule for the translator in Soot,
which says that the first parameter, @parameter0, in Java will be translated
to two local variables, r1 and r5, and that r5 exists because there is a use
of @parameter0 in the body.
Any hints about this is highly appreciated.
Jiangfan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20110819/4d442c66/attachment.html
More information about the Soot-list
mailing list