[Soot-list] Doubt in Pointers Analysis Result

Ondrej Lhotak olhotak at sable.mcgill.ca
Wed Oct 27 23:04:37 EDT 2004


On Wed, Oct 27, 2004 at 08:20:15PM -0400, Saswat Anand wrote:
> I am seeing something that does not really match up with my understanding of
> context insensitive pointer analysis. Could you please explain the following
> situation.
> 
> void fun1( )
> {
>     Test x = new Test();
>     x.member = new Test();
> }
> 
> void fun2( )
> {
>     Test y = new Test();
>     Test z = new Test();
>     y.member = z;
>     fun1();
> }
> 
> After the call to fun1() in fun2(), I expected that the field edge from y to
> z would be intact ie." y.member = z" would still hold. But the field
> sensitive spark thinks otherwise: it calculates that the call to fun1() may
> write to 'member' field of y. Why is that so? Or I am making a mistake.

I am confused by your question. The subject of your message mentions
"Pointers Analysis", but the purported problem that you are describing
is with the side-effect analysis, not the points-to analysis.

A side-effect analysis, using the may point-to knowledge that x in fun1
cannot be aliased to y in fun2, should be able to determine that the
call to fun1 will not modify the member field that was written in the
statement "y.member = z". The side-effect analysis in Soot did indeed
determine this for me (using Spark points-to information) when I made a
class out of your example and ran it through the analysis.

Even if a may side-effect analysis could not determine this, it would be
imprecise but not unsafe.

You say "it calculates that the call to fun1() may write to 'member'
field of y". The analysis does not directly produce such statements
about fields of objects pointed to by pointers (y in this case). How
are you interpreting the result of the analysis to arrive at this
conclusion?

I don't understand what any of this has to do with context
(in)sensitivity.

Ondrej

> 
> Thanks
> Saswat
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://www.sable.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list