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

Re: Points to set look up only for Local?



I am considering extending the PointsToAnalysis interface as follows.
Would this do what you need?

    /** Returns the set of objects pointed to by variable l. */
    public PointsToSet reachingObjects( Local l );

    /** Returns the set of objects pointed to by static field f. */
    public PointsToSet reachingObjects( SootField f );

    /** Returns the set of objects pointed to by instance field f
     * of the objects in the PointsToSet s. */
    public PointsToSet reachingObjects( PointsToSet s, SootField f );

    /** Returns the set of objects pointed to by instance field f
     * of the objects pointed to by l. */
    public PointsToSet reachingObjects( Local l, SootField f );

Ondrej

On Tue, May 20, 2003 at 04:11:44PM -0400, Ondrej LHOTAK wrote:
> 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!
> >