mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Reverting to enclosing block logic
This commit is contained in:
@@ -13,6 +13,11 @@
|
||||
|
||||
import cpp
|
||||
|
||||
predicate blockDominates(Block check, Block access) {
|
||||
check.getLocation().getStartLine() <= access.getLocation().getStartLine() and
|
||||
check.getLocation().getEndLine() >= access.getLocation().getEndLine()
|
||||
}
|
||||
|
||||
predicate isCheckedInstruction(VariableAccess unchecked, VariableAccess checked) {
|
||||
checked =
|
||||
any(VariableAccess va |
|
||||
@@ -20,7 +25,7 @@ predicate isCheckedInstruction(VariableAccess unchecked, VariableAccess checked)
|
||||
) and
|
||||
//Simple test if the first access in this code path is dereferenced
|
||||
not dereferenced(checked) and
|
||||
bbDominates(checked.getBasicBlock(), unchecked.getBasicBlock())
|
||||
blockDominates(checked.getEnclosingBlock(), unchecked.getEnclosingBlock())
|
||||
}
|
||||
|
||||
predicate candidateResultUnchecked(VariableAccess unchecked) {
|
||||
|
||||
Reference in New Issue
Block a user