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

Skip to content

Commit 3ca4524

Browse files
committed
Python points-to: Improve handling of __call__() a bit.
1 parent 65a30ab commit 3ca4524

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/ql/src/semmle/python/objects/Instances.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class SpecificInstanceInternal extends TSpecificInstance, ObjectInternal {
5959
}
6060

6161
override predicate callResult(ObjectInternal obj, CfgOrigin origin) {
62-
// In general instances aren't callable, but some are...
63-
// TO DO -- Handle cases where class overrides __call__
64-
none()
62+
// TO DO -- Handle cases where class overrides __call__ in more detail, like normal calls.
63+
this.getClass().(ClassObjectInternal).lookup("__call__", _, _) and
64+
obj = ObjectInternal::unknown() and origin = CfgOrigin::unknown()
6565
}
6666

6767
override int intValue() {

0 commit comments

Comments
 (0)