[Soot-list] Bug in soot.util.ArraySet

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Sep 1 07:56:26 EDT 2009


Thanks for reporting this.

I agree with your fix. I have checked in an updated version.

Eric

2009/9/1 Khilan Gudka <khilan at doc.ic.ac.uk>:
> Dear all,
> There appears to be a bug in the addAll method of soot.util.ArraySet. In
> particular, it iterates through the 'elements' array of the ArraySet being
> imported from but doesn't stop at the last real element (the 'elements'
> array contains nulls for non-existent elements):
> for (Object element : as.elements)
> ret = add( (E)element ) | ret;
> I think it should be something like:
> int asSize = as.size();
> Object[] asElements = as.elements;
> for (int i=0; i<asSize; i++)
> ret = add( (E)asElements[i] ) | ret;
> --
> Khilan Gudka
> PhD Student
> Department of Computing
> Imperial College London
> http://www.doc.ic.ac.uk/~khilan/
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Eric Bodden
Software Technology Group
Technical University Darmstadt, Germany


More information about the Soot-list mailing list