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

Skip to content

Commit 32dabce

Browse files
committed
Python: Ignore dead objects from library trap files.
1 parent b3d9350 commit 32dabce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ private cached predicate is_an_object(@py_object obj) {
1010
exists(@py_cobject mod_type | py_special_objects(mod_type, "ModuleType") and py_cobjecttypes(obj, mod_type)) and
1111
exists(Module m | py_cobjectnames(obj, m.getName()))
1212
)
13+
and (
14+
/* Exclude unmatched builtin objects in the library trap files */
15+
obj instanceof ControlFlowNode or
16+
py_cobjectnames(obj, _) or
17+
py_cobjecttypes(obj, _) or
18+
py_special_objects(obj, _)
19+
)
1320
}
1421

1522
/** Instances of this class represent objects in the Python program. However, since

0 commit comments

Comments
 (0)