[Soot-list] Bug in ArrayPackedSet.equals()

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Sep 27 19:17:45 EDT 2011


Thanks for reporting this.

I have committed the following:

    public boolean equals(Object otherFlow)
    {
      if (sameType(otherFlow)) {
        return Arrays.equals(bits, ((ArrayPackedSet)otherFlow).bits);
      } else
        return super.equals(otherFlow);
    }

I think this should fix the problem.

Eric

On 26 September 2011 23:45, Karthik <reachsrk at gmail.com> wrote:
> Hi,
>
> I have been working with a BackwardFlowAnalysis that I have implemented, and
> it doesn't work for programs which have loops i.e. the ones that require
> more than one iteration of backward analysis. The BackwardFlowAnalysis does
> a
>
> if(!beforeFlow.equals(previousBeforeFlow)) {
>     ... add to changedUnits...
> }
>
>
> The code for ArrayPackedSet equals method as of soot 2.4 release is
>
>     public boolean equals(Object otherFlow)
>     {
>       if (sameType(otherFlow)) {
>         for (int element : bits)
>             if(element != element)
>                 return false;
>
>         return true;
>       } else
>         return super.equals(otherFlow);
>     }
>
> As can be seen, this trivially returns true for all otherFlow objects of the
> sameType().
> This is true as of soot 2.4 as well as trunk.
>
>
> Karthik Ramachandra
> IIT Bombay.
> http://www.cse.iitb.ac.in/~karthiksr
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Dr. Eric Bodden, http://bodden.de/
Principal Investigator in Secure Services at CASED
Coordinator of the CASED Advisory Board of Study Affairs
PostDoc at Software Technology Group, Technische Universität Darmstadt
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list