Skip to content

Commit b9ef8a0

Browse files
committed
Python: Extend hasAttribute to unknown-but-defined module variables.
1 parent 0801e51 commit b9ef8a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ abstract class ModuleObject extends Object {
5454

5555
predicate hasAttribute(string name) {
5656
exists(theModule().attr(name))
57+
or
58+
exists(SsaVariable var | name = var.getId() and var.getAUse() = this.getModule().getANormalExit())
5759
}
5860

5961
predicate attributeRefersTo(string name, Object obj, ControlFlowNode origin) {

0 commit comments

Comments
 (0)