mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
SSA: Replace the Guards interface in the SSA data flow integration.
This commit is contained in:
@@ -667,10 +667,13 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
}
|
||||
|
||||
class Guard extends Guards::Guard {
|
||||
predicate hasCfgNode(BasicBlock bb, int i) {
|
||||
this = bb.getNode(i).asExpr()
|
||||
or
|
||||
this = bb.getNode(i).asStmt()
|
||||
/**
|
||||
* Holds if the control flow branching from `bb1` is dependent on this guard,
|
||||
* and that the edge from `bb1` to `bb2` corresponds to the evaluation of this
|
||||
* guard to `branch`.
|
||||
*/
|
||||
predicate controlsBranchEdge(BasicBlock bb1, BasicBlock bb2, boolean branch) {
|
||||
super.hasBranchEdge(bb1, bb2, branch)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,11 +681,6 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
predicate guardControlsBlock(Guard guard, BasicBlock bb, boolean branch) {
|
||||
guard.controls(bb, branch)
|
||||
}
|
||||
|
||||
/** Gets an immediate conditional successor of basic block `bb`, if any. */
|
||||
BasicBlock getAConditionalBasicBlockSuccessor(BasicBlock bb, boolean branch) {
|
||||
result = bb.(Guards::ConditionBlock).getTestSuccessor(branch)
|
||||
}
|
||||
}
|
||||
|
||||
private module DataFlowIntegrationImpl = Impl::DataFlowIntegration<DataFlowIntegrationInput>;
|
||||
|
||||
Reference in New Issue
Block a user