Skip to content

Commit ab856d6

Browse files
committed
Python: Show getCallableForArgument can have multiple results
1 parent abf2902 commit ab856d6

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private predicate typePreservingStep(Node nodeFrom, Node nodeTo) {
8888
}
8989

9090
/**
91-
* Gets the callable for the call where `nodeFrom` is used as the `i`'th argument.
91+
* Gets a callable for the call where `nodeFrom` is used as the `i`'th argument.
9292
*
9393
* Helper predicate to avoid bad join order experienced in `callStep`.
9494
* This happened when `isParameterOf` was joined _before_ `getCallable`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def foo(foo_x): # $tracked
2+
print("foo", foo_x) # $tracked
3+
4+
5+
def bar(bar_x): # $tracked
6+
print("bar", bar_x) # $tracked
7+
8+
9+
if len(__file__) % 2 == 0:
10+
f = foo
11+
else:
12+
f = bar
13+
14+
x = tracked # $tracked
15+
f(x) # $tracked

0 commit comments

Comments
 (0)