mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Show getCallableForArgument can have multiple results
This commit is contained in:
@@ -88,7 +88,7 @@ private predicate typePreservingStep(Node nodeFrom, Node nodeTo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the callable for the call where `nodeFrom` is used as the `i`'th argument.
|
||||
* Gets a callable for the call where `nodeFrom` is used as the `i`'th argument.
|
||||
*
|
||||
* Helper predicate to avoid bad join order experienced in `callStep`.
|
||||
* This happened when `isParameterOf` was joined _before_ `getCallable`.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
def foo(foo_x): # $tracked
|
||||
print("foo", foo_x) # $tracked
|
||||
|
||||
|
||||
def bar(bar_x): # $tracked
|
||||
print("bar", bar_x) # $tracked
|
||||
|
||||
|
||||
if len(__file__) % 2 == 0:
|
||||
f = foo
|
||||
else:
|
||||
f = bar
|
||||
|
||||
x = tracked # $tracked
|
||||
f(x) # $tracked
|
||||
Reference in New Issue
Block a user