private void executePost() { this.transition = false; if (currentCheckerIndex < checks.size()) { explodedGraphWalker.programState = checks.get(currentCheckerIndex).checkPostStatement(this, syntaxNode); } else { if (explodedGraphWalker.programPosition.i< explodedGraphWalker.programPosition.block.elements().size()) { explodedGraphWalker.clearStack(explodedGraphWalker.programPosition.block.elements().get(explodedGraphWalker.programPosition.i)); } explodedGraphWalker.enqueue( new ExplodedGraph.ProgramPoint(explodedGraphWalker.programPosition.block, explodedGraphWalker.programPosition.i + 1), explodedGraphWalker.programState, explodedGraphWalker.node.exitPath); return; } if (!transition) { addTransition(explodedGraphWalker.programState); } }
steps = 0; for (ProgramState startingState : startingStates(tree, programState)) { enqueue(new ExplodedGraph.ProgramPoint(cfg.entry(), 0), startingState);
enqueue(new ExplodedGraph.ProgramPoint(block.exitBlock(), 0), programState, true); } else { for (CFG.Block successor : block.successors()) { enqueue(new ExplodedGraph.ProgramPoint(successor, 0), programState, true); for (CFG.Block successor : block.successors()) { if (!block.isFinallyBlock() || successor != block.exitBlock()) { enqueue(new ExplodedGraph.ProgramPoint(successor, 0), programState, successor == block.exitBlock());
private void handleBranch(CFG.Block programPosition, Tree condition, boolean checkPath) { Pair<List<ProgramState>, List<ProgramState>> pair = constraintManager.assumeDual(programState); ExplodedGraph.ProgramPoint falseBlockProgramPoint = new ExplodedGraph.ProgramPoint(programPosition.falseBlock(), 0); for (ProgramState state : pair.a) { // enqueue false-branch, if feasible ProgramState ps = state.stackValue(SymbolicValue.FALSE_LITERAL); enqueue(falseBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseChecker.evaluatedToFalse(condition); } } ExplodedGraph.ProgramPoint trueBlockProgramPoint = new ExplodedGraph.ProgramPoint(programPosition.trueBlock(), 0); for (ProgramState state : pair.b) { ProgramState ps = state.stackValue(SymbolicValue.TRUE_LITERAL); // enqueue true-branch, if feasible enqueue(trueBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseChecker.evaluatedToTrue(condition); } } }