@@ -34,15 +34,18 @@ abstract class PDUVar[+Value <: ValueInformation] {
3434}
3535
3636class PDVar [+ Value <: ValueInformation /* org.opalj.ai.ValuesDomain#DomainValue*/ ] private (
37- val value : Value ,
38- val usePCs : PCs
37+ val originPC : Int ,
38+ val value : Value ,
39+ val usePCs : PCs
3940) extends PDUVar [Value ] {
4041
4142 def defPCs : Nothing = throw new UnsupportedOperationException
4243
44+ override def hashCode (): Int = scala.util.hashing.MurmurHash3 .productHash((originPC, usePCs))
45+
4346 override def equals (other : Any ): Boolean = {
4447 other match {
45- case that : PDVar [_] => this .usePCs == that.usePCs
48+ case that : PDVar [_] => this .originPC == that.originPC && this . usePCs == that.usePCs
4649 case _ => false
4750 }
4851 }
@@ -54,9 +57,11 @@ class PDVar[+Value <: ValueInformation /*org.opalj.ai.ValuesDomain#DomainValue*/
5457
5558object PDVar {
5659
57- def apply [Value <: ValueInformation ](value : Value , useSites : IntTrieSet ): PDVar [Value ] = new PDVar (value, useSites)
60+ def apply [Value <: ValueInformation ](originSite : Int , value : Value , useSites : IntTrieSet ): PDVar [Value ] =
61+ new PDVar (originSite, value, useSites)
5862
59- def unapply [Value <: ValueInformation ](d : PDVar [Value ]): Some [(Value , IntTrieSet )] = Some ((d.value, d.usePCs))
63+ def unapply [Value <: ValueInformation ](d : PDVar [Value ]): Some [(Int , Value , IntTrieSet )] =
64+ Some ((d.originPC, d.value, d.usePCs))
6065}
6166
6267class PUVar [+ Value <: ValueInformation /* org.opalj.ai.ValuesDomain#DomainValue*/ ] private (
@@ -66,6 +71,8 @@ class PUVar[+Value <: ValueInformation /*org.opalj.ai.ValuesDomain#DomainValue*/
6671
6772 def usePCs : Nothing = throw new UnsupportedOperationException
6873
74+ override def hashCode (): Int = defPCs.hashCode()
75+
6976 override def equals (other : Any ): Boolean = {
7077 other match {
7178 case that : PUVar [_] => this .defPCs == that.defPCs
0 commit comments