Skip to content

Commit 39590a3

Browse files
committed
Python: Rename helper predicate based on review
1 parent 1413615 commit 39590a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

python/ql/src/semmle/python/dataflow/new/TypeTracker.qll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,13 @@ private predicate typePreservingStep(Node nodeFrom, Node nodeTo) {
8888
}
8989

9090
/**
91-
* Helper predicate to avoid bad join order experienced in `callStep`.
91+
* Gets a callable for the call where `nodeFrom` is used as the `i`'th argument.
9292
*
93+
* Helper predicate to avoid bad join order experienced in `callStep`.
9394
* This happened when `isParameterOf` was joined _before_ `getCallable`.
9495
*/
9596
pragma[nomagic]
96-
private DataFlowCallable callStepHelper(ArgumentNode nodeFrom, int i) {
97+
private DataFlowCallable getCallableForArgument(ArgumentNode nodeFrom, int i) {
9798
exists(DataFlowCall call |
9899
nodeFrom.argumentOf(call, i) and
99100
result = call.getCallable()
@@ -104,7 +105,7 @@ private DataFlowCallable callStepHelper(ArgumentNode nodeFrom, int i) {
104105
predicate callStep(ArgumentNode nodeFrom, ParameterNode nodeTo) {
105106
// TODO: Support special methods?
106107
exists(DataFlowCallable callable, int i |
107-
callable = callStepHelper(nodeFrom, i) and
108+
callable = getCallableForArgument(nodeFrom, i) and
108109
nodeTo.isParameterOf(callable, i)
109110
)
110111
}

0 commit comments

Comments
 (0)