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

Re: Points to set look up only for Local?



The PointsToAnalysis interface is very simplistic, as you noticed. This
is mainly because in the past, it was used as an interface to VTA, among
other things, which did not compute the points-to sets of instance
fields of specific objects.

In Spark, methods could certainly be added to give the points-to sets of static
fields and instance fields. For static fields, the implementation
would be the same as for Locals (see reachingObjects in PAG.java),
except that a SootField would be passed rather than a Local. 
For instance fields, things are a bit more complicated, because you need
to somehow represent the allocation site. If you already have a Spark
AllocNode an, you can get a node for a specific field of it by calling
an.dot( field ). Then, on the resulting AllocDotField, you just call 
getP2Set().

I hope this helps.

Ondrej

On Tue, May 20, 2003 at 03:21:54PM -0400, Chen Fu wrote:
> Hi
> 
> I'm looking at the points to analysis in soot and I found the only
> lookup method provided in the interface is like:
> 
>     public PointsToSet reachingObjects( SootMethod method, Stmt stmt,
>             Local l );
> 
> So it can only provide points to set lookup for Local variables?
> What if I want to know the points to set of a static field or field of some
> object(represented by allocation node)?
> 
> Thanks!
>