import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
-import Util.Tuple;
+import Util.Pair;
import Analysis.Disjoint.*;
import Analysis.MLP.CodePlan;
import IR.State;
//This keeps track of taints we've traversed to prevent printing duplicate traverse functions
//The Integer keeps track of the weakly connected group it's in (used in enumerateHeapRoots)
private Hashtable<Taint, Integer> doneTaints;
- private Hashtable<Tuple, Integer> idMap=new Hashtable<Tuple,Integer>();
- private Hashtable<Tuple, Integer> weakMap=new Hashtable<Tuple,Integer>();
+ private Hashtable<Pair, Integer> idMap=new Hashtable<Pair,Integer>();
+ private Hashtable<Pair, Integer> weakMap=new Hashtable<Pair,Integer>();
private Hashtable<Taint, Set<Effect>> globalEffects;
private Hashtable<Taint, Set<Effect>> globalConflicts;
}
public int getWeakID(TempDescriptor invar, FlatNode fn) {
- return weakMap.get(new Tuple(invar, fn)).intValue();
+ return weakMap.get(new Pair(invar, fn)).intValue();
}
public int getTraverserID(TempDescriptor invar, FlatNode fn) {
- Tuple t=new Tuple(invar, fn);
+ Pair t=new Pair(invar, fn);
if (idMap.containsKey(t))
return idMap.get(t).intValue();
int value=currentID++;
if(t.isRBlockTaint()) {
int id=connectedHRHash.get(t).id;
- Tuple tup=new Tuple(t.getVar(),t.getSESE());
+ Pair tup=new Pair(t.getVar(),t.getSESE());
if (weakMap.containsKey(tup)) {
if (weakMap.get(tup).intValue()!=id)
throw new Error("Var/SESE not unique for weak component.");
--- /dev/null
+package Util;
+
+public class Pair {
+ private Object a;
+ private Object b;
+ public Pair(Object a, Object b) {
+ this.a=a;
+ this.b=b;
+ }
+ public int hashCode() {
+ return a.hashCode()*31+b.hashCode();
+ }
+ public boolean equals(Object o) {
+ if (!(o instanceof Pair))
+ return false;
+ Pair t=(Pair)o;
+ return a.equals(t.a)&&b.equals(t.b);
+ }
+}
\ No newline at end of file
+++ /dev/null
-package Util;
-
-public class Tuple {
- private Object a;
- private Object b;
- public Tuple(Object a, Object b) {
- this.a=a;
- this.b=b;
- }
- public int hashCode() {
- return a.hashCode()*31+b.hashCode();
- }
- public boolean equals(Object o) {
- if (!(o instanceof Tuple))
- return false;
- Tuple t=(Tuple)o;
- return a.equals(t.a)&&b.equals(t.b);
- }
-}
\ No newline at end of file