Reverting to enclosing block logic

This commit is contained in:
Philippe Antoine
2020-07-10 14:58:00 +02:00
parent 50b2b12ce2
commit bf7e3a004e

View File

@@ -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) {