Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 033529e

Browse files
committed
Python: avoid creating big predicate
1 parent 543876f commit 033529e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

python/ql/src/experimental/dataflow/internal/DataFlowPublic.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ class GuardNode extends ControlFlowNode {
157157

158158
GuardNode() { this = conditionBlock.getLastNode() }
159159

160-
predicate controlsNode(ControlFlowNode node, boolean testIsTrue) {
161-
conditionBlock.controls(node.getBasicBlock(), testIsTrue)
160+
predicate controlsBlock(BasicBlock b, boolean testIsTrue) {
161+
conditionBlock.controls(b, testIsTrue)
162162
}
163163
}
164164

@@ -181,7 +181,7 @@ class BarrierGuard extends GuardNode {
181181
AdjacentUses::aUse(def, node) and
182182
this.checks(node, testIsTrue) and
183183
AdjacentUses::aUse(def, result.asCfgNode()) and
184-
this.controlsNode(result.asCfgNode(), testIsTrue)
184+
this.controlsBlock(result.asCfgNode().getBasicBlock(), testIsTrue)
185185
)
186186
}
187187
}

python/ql/test/experimental/dataflow/tainttracking/customSanitizer/TestTaint.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ query predicate sanitizerGuardControls(
3838
) {
3939
exists(guard.getLocation().getFile().getRelativePath()) and
4040
conf.isSanitizerGuard(guard) and
41-
guard.controlsNode(node, testIsTrue)
41+
guard.controlsBlock(node.getBasicBlock(), testIsTrue)
4242
}
4343

4444
query predicate sanitizerGuardedNode(

0 commit comments

Comments
 (0)