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

Khilan Gudka khilan at doc.ic.ac.uk
Tue Sep 1 06:37:48 EDT 2009


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/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090901/4edb5407/attachment.html 


More information about the Soot-list mailing list