[Soot-list] pointsTo analysis - spark

Patrick Lam plam at sable.mcgill.ca
Wed Jun 24 20:21:33 EDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Points-to sets are going to be empty unless the code you're trying to
analyze is reachable from the program's entry point.

pat

Cristina Basescu wrote:
> 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
> <mailto: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
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpCww0ACgkQNTVxnNGEyOhpVACfS7zHM3r++yrWyBH4UTvzl0xB
BUEAmwTbdhgds3K2/DCiDTWL/POAeG73
=XvYo
-----END PGP SIGNATURE-----


More information about the Soot-list mailing list