[Soot-list] hashCode() generates different values

Eric Bodden eric.bodden at mail.mcgill.ca
Sun Mar 30 06:43:02 EDT 2008


Hi.

Normally, Units do not implement hashCode(), which means that you get
different hash codes because you have different Unit objects in the
different passes.

So something between your two passes is replacing units by other
(equivalent) units. You have to figure out what's doing the
replacement.

When do you execute your 1st and 2nd pass? What's running in between?
Why do you need to keep trac kof units anyway?

Eric

On 30/03/2008, Alvin Yan <feiya200 at cs.uregina.ca> wrote:
>
>
> Dear all,
>
> I was trying to run hashCode() on Unit objects to get a "index" of the Unit
> for further use. However when I iterating over the unit chain and printing
> out the hashCode(), they're different at different times! How do I maintain
> the same value every time I get the hashCode?
>
> For e.g. pass 1 I got
> 10607274 r0 := @parameter0: java.lang.String[]
> 10574362 r1 = null
> 19045313 $r4 = new java.util.Vector
> 8542488 specialinvoke $r4.<java.util.Vector: void <init>()>()
> 27738150 r2 = $r4
> 8255364 $i1 = lengthof r0
>
> and pass 2 I got
> 21369517 r0 := @parameter0: java.lang.String[]
> 23486952 r1 = null
> 10866763 $r4 = new java.util.Vector
> 17923496 specialinvoke $r4.<java.util.Vector: void <init>()>()
> 22070539 r2 = $r4
> 17530016 $i1 = lengthof r0
>
> The hashcodes are completely different.
> Anyone can help me on this?
>
> Alvin
> _______________________________________________
>  Soot-list mailing list
>  Soot-list at sable.mcgill.ca
>  http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


More information about the Soot-list mailing list