void enqueue(ProgramPoint pp, ProgramState programState) { int nbOfExecution = programState.numberOfTimeVisited(pp); if (nbOfExecution > MAX_EXEC_PROGRAM_POINT) { return; } ProgramState ps = programState.visitedPoint(pp, nbOfExecution + 1); ExplodedGraph.Node cachedNode = explodedGraph.node(pp, ps); cachedNode.addParent(node, null); if (cachedNode.isNew()) { workList.addFirst(cachedNode); } }
void enqueue(ProgramPoint pp, ProgramState programState) { int nbOfExecution = programState.numberOfTimeVisited(pp); if (nbOfExecution > MAX_EXEC_PROGRAM_POINT) { return; } ProgramState ps = programState.visitedPoint(pp, nbOfExecution + 1); ExplodedGraph.Node cachedNode = explodedGraph.node(pp, ps); cachedNode.addParent(node, null); if (cachedNode.isNew()) { workList.addFirst(cachedNode); } }
public void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check) { // in order to create such Exceptional Yield, a parameter of the method has to be the cause of the exception if (methodBehavior != null && methodBehavior.parameters().contains(target)) { Type exceptionType = semanticModel.getClassType(exceptionFullyQualifiedName); ProgramState newExceptionalState = exceptionalState.clearStack().stackValue(constraintManager.createExceptionalSymbolicValue(exceptionType)); ExplodedGraph.Node exitNode = explodedGraph.node(node.programPoint, newExceptionalState); methodBehavior.createExceptionalCheckBasedYield(target, exitNode, exceptionFullyQualifiedName, check); exitNode.addParent(node, null); } }
public void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check) { // in order to create such Exceptional Yield, a parameter of the method has to be the cause of the exception if (methodBehavior != null && methodBehavior.parameters().contains(target)) { Type exceptionType = semanticModel.getClassType(exceptionFullyQualifiedName); ProgramState newExceptionalState = exceptionalState.clearStack().stackValue(constraintManager.createExceptionalSymbolicValue(exceptionType)); ExplodedGraph.Node exitNode = explodedGraph.node(node.programPoint, newExceptionalState); methodBehavior.createExceptionalCheckBasedYield(target, exitNode, exceptionFullyQualifiedName, check); exitNode.addParent(node, null); } }
public void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath, @Nullable MethodYield methodYield) { ProgramPoint programPoint = newProgramPoint; int nbOfExecution = programState.numberOfTimeVisited(programPoint); if (nbOfExecution > MAX_EXEC_PROGRAM_POINT) { if (isRestartingForEachLoop(programPoint)) { // reached the max number of visit by program point, so take the false branch with current program state programPoint = new ProgramPoint(((CFG.Block) programPoint.block).falseBlock()); } else { debugPrint(programPoint); return; } } checkExplodedGraphTooBig(programState); ProgramState ps = programState.visitedPoint(programPoint, nbOfExecution + 1); ExplodedGraph.Node cachedNode = explodedGraph.node(programPoint, ps); if (!cachedNode.isNew() && exitPath == cachedNode.exitPath) { // has been enqueued earlier cachedNode.addParent(node, methodYield); return; } cachedNode.exitPath = exitPath; cachedNode.addParent(node, methodYield); workList.addFirst(cachedNode); }
public void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath, @Nullable MethodYield methodYield) { ProgramPoint programPoint = newProgramPoint; int nbOfExecution = programState.numberOfTimeVisited(programPoint); if (nbOfExecution > MAX_EXEC_PROGRAM_POINT) { if (isRestartingForEachLoop(programPoint)) { // reached the max number of visit by program point, so take the false branch with current program state programPoint = new ProgramPoint(((CFG.Block) programPoint.block).falseBlock()); } else { debugPrint(programPoint); return; } } checkExplodedGraphTooBig(programState); ProgramState ps = programState.visitedPoint(programPoint, nbOfExecution + 1); ExplodedGraph.Node cachedNode = explodedGraph.node(programPoint, ps); if (!cachedNode.isNew() && exitPath == cachedNode.exitPath) { // has been enqueued earlier cachedNode.addParent(node, methodYield); return; } cachedNode.exitPath = exitPath; cachedNode.addParent(node, methodYield); workList.addFirst(cachedNode); }