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

Skip to content

Commit 2d4f64f

Browse files
committed
Python legacy objects: fix function/method call.
1 parent 989d587 commit 2d4f64f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

python/ql/src/semmle/python/types/FunctionObject.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,15 @@ abstract class FunctionObject extends Object {
4747

4848
/** Gets a call-site from where this function is called as a function */
4949
CallNode getAFunctionCall() {
50-
result.getFunction() instanceof NameNode and
51-
result = this.getACall()
50+
result.getFunction().inferredValue() = theCallable()
5251
}
5352

5453
/** Gets a call-site from where this function is called as a method */
5554
CallNode getAMethodCall() {
56-
result.getFunction() instanceof AttrNode and
57-
result = this.getACall()
55+
exists(BoundMethodObjectInternal bm |
56+
result.getFunction().inferredValue() = bm and
57+
bm.getFunction() = theCallable()
58+
)
5859
}
5960

6061
/** Gets a call-site from where this function is called */

0 commit comments

Comments
 (0)