mirror of
https://github.com/github/codeql.git
synced 2026-05-25 00:27:09 +02:00
Merge pull request #242 from microsoft/powershell-guardpredicate-fix
added hasbranchedge
This commit is contained in:
1
.github/workflows/sync-main.yml
vendored
1
.github/workflows/sync-main.yml
vendored
@@ -88,3 +88,4 @@ jobs:
|
||||
fi
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
|
||||
|
||||
|
||||
@@ -278,12 +278,21 @@ private module DataFlowIntegrationInput implements Impl::DataFlowIntegrationInpu
|
||||
* guard to `branch`.
|
||||
*/
|
||||
predicate controlsBranchEdge(SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch) {
|
||||
hasBranchEdge(bb1, bb2, branch)
|
||||
}
|
||||
/**
|
||||
* Holds if the evaluation of this guard to `branch` corresponds to the edge
|
||||
* from `bb1` to `bb2`.
|
||||
*/
|
||||
predicate hasBranchEdge(SsaInput::BasicBlock bb1, SsaInput::BasicBlock bb2, boolean branch) {
|
||||
exists(Cfg::SuccessorTypes::ConditionalSuccessor s |
|
||||
this.getBasicBlock() = bb1 and
|
||||
bb2 = bb1.getASuccessor(s) and
|
||||
s.getValue() = branch
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** Holds if the guard `guard` controls block `bb` upon evaluating to `branch`. */
|
||||
|
||||
Reference in New Issue
Block a user