Commit c2f7f94d authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Add value dependency between the active exception definition and its...

Add value dependency between the active exception definition and its throw/exception return statement.
parent 5ae5c2ae
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ package es.upv.mist.slicing.graphs.jsysdg;
import es.upv.mist.slicing.arcs.pdg.FlowDependencyArc;
import es.upv.mist.slicing.arcs.pdg.ObjectFlowDependencyArc;
import es.upv.mist.slicing.arcs.pdg.TotalDefinitionDependenceArc;
import es.upv.mist.slicing.graphs.exceptionsensitive.ESCFG;
import es.upv.mist.slicing.graphs.exceptionsensitive.ESPDG;
import es.upv.mist.slicing.graphs.pdg.PDG;
import es.upv.mist.slicing.nodes.GraphNode;
@@ -86,6 +87,7 @@ public class JSysPDG extends ESPDG {
            addSyntheticNodesToPDG();
            applyTreeConnections();
            buildJSysDataDependency();
            valueDependencyForThrowStatements();
        }

        protected void buildJSysDataDependency() {
@@ -186,5 +188,15 @@ public class JSysPDG extends ESPDG {
            addVertex(memberNode);
            addControlDependencyArc(memberNode.getParent(), memberNode);
        }

        protected void valueDependencyForThrowStatements() {
            for (GraphNode<?> node : vertexSet()) {
                for (VariableAction action : node.getVariableActions()) {
                    if (action.isDefinition() && action.getName().equals(ESCFG.ACTIVE_EXCEPTION_VARIABLE)) {
                        addValueDependencyArc(action, "-root-", node);
                    }
                }
            }
        }
    }
}