From: bdemsky Date: Wed, 16 Mar 2011 22:56:56 +0000 (+0000) Subject: pushing changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bfc46baa5f759e665205a9a08588eab4a1716a9a;p=IRC.git pushing changes --- diff --git a/Robust/src/Analysis/Pointer/Pointer.java b/Robust/src/Analysis/Pointer/Pointer.java index 60bed045..e704b51f 100644 --- a/Robust/src/Analysis/Pointer/Pointer.java +++ b/Robust/src/Analysis/Pointer/Pointer.java @@ -6,6 +6,7 @@ import Analysis.Liveness; import Analysis.Pointer.BasicBlock.BBlock; import Analysis.Pointer.AllocFactory.AllocNode; import Analysis.Disjoint.Taint; +import Analysis.CallGraph.CallGraph; import java.io.*; public class Pointer { @@ -16,12 +17,18 @@ public class Pointer { HashMap> returnMap; HashMap> bblivetemps; + CallGraph callGraph; State state; TypeUtil typeUtil; AllocFactory allocFactory; LinkedList toprocess; TempDescriptor returntmp; + public Pointer(State state, TypeUtil typeUtil, CallGraph callGraph) { + this(state, typeUtil); + this.callGraph=callGraph; + } + public Pointer(State state, TypeUtil typeUtil) { this.state=state; this.blockMap=new HashMap(); @@ -389,15 +396,20 @@ public class Pointer { } Delta processSESEEnter(FlatSESEEnterNode sese, Delta delta, Graph graph) { - for (TempDescriptor tmp:sese.getInVarSet()) { - Taint taint=Taint.factory(sese, null, tmp, null, sese, null); - if (delta.getInit()) { + if (delta.getInit()) { + removeInitTaints(null, delta, graph); + for (TempDescriptor tmp:sese.getInVarSet()) { + Taint taint=Taint.factory(sese, null, tmp, null, sese, null); MySet edges=GraphManip.getEdges(graph, delta, tmp); for(Edge e:edges) { Edge newe=e.addTaint(taint); delta.addVarEdge(newe); } - } else { + } + } else { + removeDiffTaints(null, delta, graph); + for (TempDescriptor tmp:sese.getInVarSet()) { + Taint taint=Taint.factory(sese, null, tmp, null, sese, null); MySet edges=GraphManip.getDiffEdges(delta, tmp); for(Edge e:edges) { Edge newe=e.addTaint(taint); @@ -405,10 +417,40 @@ public class Pointer { } } } + + applyDiffs(graph, delta); return delta; } + private boolean isRecursive(FlatSESEEnterNode sese) { + MethodDescriptor md=sese.getmdEnclosing(); + return callGraph.getCalleeSet(md).contains(md); + } + + + Delta processSESEExit(FlatSESEExitNode seseexit, Delta delta, Graph graph) { + FlatSESEEnterNode sese=seseexit.getFlatEnter(); + //Strip Taints from this SESE + if (delta.getInit()) { + removeInitTaints(isRecursive(sese)?sese:null, delta, graph); + } else { + removeDiffTaints(isRecursive(sese)?sese:null, delta, graph); + } + applyDiffs(graph, delta); + return delta; + } + + void removeInitTaints(FlatSESEEnterNode sese, Delta delta, Graph graph) { + + } + + void processEdgeMap(FlatSESEEnterNode sese, Delta delta, Graph graph, HashMap> edgemap) { + } + + void removeDiffTaints(FlatSESEEnterNode sese, Delta delta, Graph graph) { + + } /* This function compute the edges for the this variable for a * callee if it exists. */