[Soot-list] pointsTo analysis - spark

Cristina Basescu cristina.basescu at gmail.com
Wed Jun 24 17:25:42 EDT 2009


I analyzed more in-depth the API and I thought obtaining the FieldRefNode
for the non-static field and calling makeP2Set() should do the trick:

soot.PointsToAnalysis pta = Scene.v().getPointsToAnalysis();
if(value instanceof SootField) {
  if(((SootField)value).isStatic() == false) {
        // sc is the SootClass value is from
        FieldRefNode frn = ((PAG)pta).findGlobalFieldRefNode(getBase(sc),
(SootField)value);
        if(frn == null) {
              frn = ((PAG)pta).findLocalFieldRefNode(getBase(sc),
(SootField)value);
              if(frn != null) {
                   PointsToSet r = frn.makeP2Set();
               }
         }
   }
}

frn is not null (so I believe I shouldn't alloc a new node), however the
PointsToSet r is empty.

Another attempt was to use doAddStoreEdge for statements instance of
DefinitionStmt, where the left op is a non-static field and the right op is
something different from a non-static field. I expected this to cause
makeP2Set to return for the left value at least the PointsToSet the right
value has, however it still returns an empty PointsToSet.

Any ideas what I am doing wrong? The code I tested this on is:

public class B {
    Object obj;
    void f(Object l1, Object l2, Object l3) {
        obj = l1;
   }
...
}

Thank you!

Best regards,
Cristina

On Tue, Jun 23, 2009 at 4:00 PM, Hamid 2C <hamid2c at gmail.com> wrote:

> > Hello!
> >
> > I'm trying to implement an alias analysis using the Spark framework. My
> > question is, is there possible to get the set of objects pointed to by a
> > SootField that is not static?
>
> Yes, Spark analysis is field-sensitive by default. See concrete field
> nodes (AllocDotField node in the code) for more information.
>
> Hamid
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090625/e3121a9d/attachment.html 


More information about the Soot-list mailing list