public void enqueue(ProgramPoint programPoint, ProgramState programState) { enqueue(programPoint, programState, false); }
public void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath) { enqueue(newProgramPoint, programState, exitPath, null); }
public void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath) { enqueue(newProgramPoint, programState, exitPath, null); }
public void enqueue(ExplodedGraph.ProgramPoint programPoint, ProgramState programState) { enqueue(programPoint, programState, false); }
public void enqueue(ProgramPoint programPoint, ProgramState programState) { enqueue(programPoint, programState, false); }
public void enqueue(ProgramPoint programPoint, ProgramState programState, @Nullable MethodYield methodYield) { enqueue(programPoint, programState, false, methodYield); }
public void enqueue(ProgramPoint programPoint, ProgramState programState, @Nullable MethodYield methodYield) { enqueue(programPoint, programState, false, methodYield); }
.collect(Collectors.toList()); if (!caughtBlocks.isEmpty()) { caughtBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); return; .forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); .findFirst() .orElse(exitBlock); enqueue(new ProgramPoint(methodExit), ps, true, methodYield); } else { otherBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, true, methodYield));
.collect(Collectors.toList()); if (!caughtBlocks.isEmpty()) { caughtBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); return; .forEach(b -> enqueue(new ProgramPoint(b), ps, methodYield)); .findFirst() .orElse(exitBlock); enqueue(new ProgramPoint(methodExit), ps, true, methodYield); } else { otherBlocks.forEach(b -> enqueue(new ProgramPoint(b), ps, true, methodYield));
private void executePost() { this.transition = false; if (currentCheckerIndex < checks.size()) { explodedGraphWalker.programState = checks.get(currentCheckerIndex).checkPostStatement(this, syntaxNode); } else { CFG.Block block = (CFG.Block) explodedGraphWalker.programPosition.block; if (explodedGraphWalker.programPosition.i< block.elements().size()) { explodedGraphWalker.clearStack(block.elements().get(explodedGraphWalker.programPosition.i)); } explodedGraphWalker.enqueue( explodedGraphWalker.programPosition.next(), explodedGraphWalker.programState, explodedGraphWalker.node.exitPath, methodYield); return; } if (!transition) { addTransition(explodedGraphWalker.programState); } }
private void executePost() { this.transition = false; if (currentCheckerIndex < checks.size()) { explodedGraphWalker.programState = checks.get(currentCheckerIndex).checkPostStatement(this, syntaxNode); } else { CFG.Block block = (CFG.Block) explodedGraphWalker.programPosition.block; if (explodedGraphWalker.programPosition.i< block.elements().size()) { explodedGraphWalker.clearStack(block.elements().get(explodedGraphWalker.programPosition.i)); } explodedGraphWalker.enqueue( explodedGraphWalker.programPosition.next(), explodedGraphWalker.programState, explodedGraphWalker.node.exitPath, methodYield); return; } if (!transition) { addTransition(explodedGraphWalker.programState); } }
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); } }
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); } } }
private void executeNewClass(NewClassTree tree) { NewClassTree newClassTree = tree; programState = programState.unstackValue(newClassTree.arguments().size()).state; // Enqueue exceptional paths ((CFG.Block) node.programPoint.block).exceptions().forEach(b -> enqueue(new ProgramPoint(b), programState, !b.isCatchBlock())); SymbolicValue svNewClass = constraintManager.createSymbolicValue(newClassTree); programState = programState.stackValue(svNewClass); programState = svNewClass.setSingleConstraint(programState, ObjectConstraint.NOT_NULL); }
private void executeNewClass(NewClassTree tree) { NewClassTree newClassTree = tree; programState = programState.unstackValue(newClassTree.arguments().size()).state; // Enqueue exceptional paths ((CFG.Block) node.programPoint.block).exceptions().forEach(b -> enqueue(new ProgramPoint(b), programState, !b.isCatchBlock())); SymbolicValue svNewClass = constraintManager.createSymbolicValue(newClassTree); programState = programState.stackValue(svNewClass); programState = svNewClass.setSingleConstraint(programState, ObjectConstraint.NOT_NULL); }
steps = 0; for (ProgramState startingState : startingStates(tree, programState)) { enqueue(new ProgramPoint(cfg.entryBlock()), startingState);
enqueue(falseBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseExpressionCollector.evaluatedToFalse(cleanupCondition((ExpressionTree) condition), node); enqueue(trueBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseExpressionCollector.evaluatedToTrue(cleanupCondition((ExpressionTree) condition), node);
enqueue(falseBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseExpressionCollector.evaluatedToFalse(cleanupCondition((ExpressionTree) condition), node); enqueue(trueBlockProgramPoint, ps, node.exitPath); if (checkPath) { alwaysTrueOrFalseExpressionCollector.evaluatedToTrue(cleanupCondition((ExpressionTree) condition), node);
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());