From 32dabcee1e1d931a77d5993a48b37dfbd9e34640 Mon Sep 17 00:00:00 2001 From: Mark Shannon Date: Tue, 5 Mar 2019 14:32:22 +0000 Subject: [PATCH] Python: Ignore dead objects from library trap files. --- python/ql/src/semmle/python/types/Object.qll | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/ql/src/semmle/python/types/Object.qll b/python/ql/src/semmle/python/types/Object.qll index 4cb5b2ed35b..bf87adfd831 100644 --- a/python/ql/src/semmle/python/types/Object.qll +++ b/python/ql/src/semmle/python/types/Object.qll @@ -10,6 +10,13 @@ private cached predicate is_an_object(@py_object obj) { exists(@py_cobject mod_type | py_special_objects(mod_type, "ModuleType") and py_cobjecttypes(obj, mod_type)) and exists(Module m | py_cobjectnames(obj, m.getName())) ) + and ( + /* Exclude unmatched builtin objects in the library trap files */ + obj instanceof ControlFlowNode or + py_cobjectnames(obj, _) or + py_cobjecttypes(obj, _) or + py_special_objects(obj, _) + ) } /** Instances of this class represent objects in the Python program. However, since