[Soot-list] hashCode() generates different values

Alvin Yan feiya200 at cs.uregina.ca
Sun Mar 30 02:50:28 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20080330/1c2c7b8f/attachment.htm


More information about the Soot-list mailing list