fix a bug for Taint similar to ReachState, when either is an element of an ExistPred...
[IRC.git] / Robust / src / Analysis / Disjoint / ExistPred.java
index 87c5e8426b44b395d451a211e01e419c0aa22222..a28d5b3ba253e62288b3124d7510138e1c668459 100644 (file)
@@ -80,7 +80,9 @@ public class ExistPred extends Canonical {
   // if the taint is non-null then the predicate
   // is true only if the edge exists AND has the
   // taint--ONLY ONE of the ne_state or e_taint
-  // may be non-null for an edge predicate
+  // may be non-null for an edge predicate, AND
+  // like the ne_state above, strip preds off this
+  // taint within a pred itself
   protected Taint e_taint;
 
 
@@ -191,7 +193,7 @@ public class ExistPred extends Canonical {
     this.e_type     = type;
     this.e_field    = field;
     this.ne_state   = removePreds( state );
-    this.e_taint    = taint;
+    this.e_taint    = removePreds( taint );
     this.predType   = TYPE_EDGE;
     n_hrnID = null;
   }
@@ -234,6 +236,10 @@ public class ExistPred extends Canonical {
     return state == null ? null : Canonical.attach( state, ExistPredSet.factory() );
   }
 
+  private Taint removePreds( Taint taint ) {
+    return taint == null ? null : Canonical.attach( taint, ExistPredSet.factory() );
+  }
+
 
 
   // only consider the subest of the caller elements that
@@ -508,7 +514,7 @@ public class ExistPred extends Canonical {
       if( pred.e_taint != null ) {
         return false;
       }
-    } else if( !e_taint.equals(pred.e_taint) ) {
+    } else if( !e_taint.equalsIgnorePreds(pred.e_taint) ) {
       return false;
     }
 
@@ -560,7 +566,7 @@ public class ExistPred extends Canonical {
       }
 
       if( e_taint != null ) {
-        hash ^= e_taint.hashCode();
+        hash ^= e_taint.hashCodeNoPreds();
       }
 
       return hash;