+++ /dev/null
-package Analysis.Disjoint;
-
-public class CanonicalWrapper {
- Canonical a;
- public Canonical b;
-
- public CanonicalWrapper(Canonical a) {
- assert a.canonicalvalue!=0;
- this.a=a;
- }
- public int hashCode() {
- return a.canonicalvalue;
- }
- public boolean equals(Object o) {
- CanonicalWrapper ro=(CanonicalWrapper)o;
- return ro.a.canonicalvalue==a.canonicalvalue;
- }
-}
\ No newline at end of file
assert edge.getSrc() == referencer;
assert edge.getDst() == referencee;
+
+ if( referencer.getReferenceTo( referencee,
+ edge.getType(),
+ edge.getField()
+ ) != null
+ ) {
+ System.out.println( " edge being added again: "+edge );
+ }
+
// edges are getting added twice to graphs now, the
// kind that should have abstract facts merged--use
// this check to prevent that
}
+
// 3. callee elements with satisfied preds come in
// 3.a) nodes
hrnCaller.setPreds( predsTrue );
}
+
// 3.b) callee -> callee edges
Iterator<RefEdge> reItr = calleeEdgesSatisfied.iterator();
while( reItr.hasNext() ) {
rsetEmpty,
predsTrue
);
- addRefEdge( rsnCaller, hrnDstCaller, reCaller );
+
+
+ // look to see if an edge with same field exists
+ // and merge with it, otherwise just add the edge
+ RefEdge edgeExisting = rsnCaller.getReferenceTo( hrnDstCaller,
+ reCallee.getType(),
+ reCallee.getField()
+ );
+ if( edgeExisting != null ) {
+ edgeExisting.setBeta(
+ Canonical.union( edgeExisting.getBeta(),
+ reCaller.getBeta()
+ )
+ );
+ edgeExisting.setPreds(
+ Canonical.join( edgeExisting.getPreds(),
+ reCaller.getPreds()
+ )
+ );
+
+ } else {
+ addRefEdge( rsnCaller, hrnDstCaller, reCaller );
+ }
+
}
// 3.c) resolve out-of-context -> callee edges
// 4.
- /*
globalSweep();
- */
+
+
if( writeDebugDOTs ) {
try {
null, null );
} catch( IOException e ) {}
}
-
}