[Soot-list] How can I tell if the two arrays overlap?

Marc-Andre Laverdiere-Papineau marc-andre.laverdiere-papineau at polymtl.ca
Wed Aug 1 11:38:26 EDT 2012


On 2012-07-31 05:00, Quentin Sabah wrote:
> Hi John,
>
>> For the set of statements that I'm interested in (statements in a loop),
>> I'll look for array references at the left of assignment statements, and for
>> each such array reference, I'll search for definitions of the array
>> references' bases (arr[i]'s base is arr) and follow such definitions until I
>> reach a newarray Jimple value. During that recursive traversal process, if I
>> run into any array bases that were found previously, then that's an
>> indication of overlapping arrays.
>
> You can use a points-to analysis to get the set of objects that may be
> reachable from an array's elements. Take a look at
> PointsToAnalysis.reachingObjectsOfArrayElement:
> http://www.sable.mcgill.ca/soot/doc/soot/PointsToAnalysis.html#reachingObjectsOfArrayElement(soot.PointsToSet)
>
> If you only need to know if a given array $a may be referenced by the 2D
> array $b, you may take a look at the intersection of the points-to set
> of variable $a and the points-to set of the $b array's elements.
>
> However, their is, to my knowledge, no existing analysis that maintain a
> points-to analysis on an array element basis. Also consider fine-tuning
> the points-to analysis to set the correct sensitivity/insensitivity to
> context and flow.
>
Hello,

I saw at some point a paper on collection disjointness that may be of 
some kind of use for the analysis you are trying to do.
http://www.lirmm.fr/~ducour/Doc-objets/ECOOP2012/SOAP/p45-chu.pdf

-- 
Marc-André Laverdière-Papineau
Étudiant au doctorat - PhD Student




More information about the Soot-list mailing list