File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
python/ql/src/semmle/python Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -424,13 +424,8 @@ module API {
424424 * a value in the module `m`.
425425 */
426426 private predicate possible_builtin_defined_in_module ( string name , Module m ) {
427- exists ( NameNode n |
428- not exists ( LocalVariable v | n .defines ( v ) ) and
429- n .isStore ( ) and
430- name = n .getId ( ) and
431- name = getBuiltInName ( ) and
432- m = n .getEnclosingModule ( )
433- )
427+ global_name_defined_in_module ( name , m ) and
428+ name = getBuiltInName ( )
434429 }
435430
436431 /**
@@ -445,6 +440,16 @@ module API {
445440 m = n .getEnclosingModule ( )
446441 }
447442
443+ /** Holds if a global variable called `name` is assigned a value in the module `m`. */
444+ private predicate global_name_defined_in_module ( string name , Module m ) {
445+ exists ( NameNode n |
446+ not exists ( LocalVariable v | n .defines ( v ) ) and
447+ n .isStore ( ) and
448+ name = n .getId ( ) and
449+ m = n .getEnclosingModule ( )
450+ )
451+ }
452+
448453 /**
449454 * Holds if `ref` is a use of a node that should have an incoming edge from `base` labeled
450455 * `lbl` in the API graph.
You can’t perform that action at this time.
0 commit comments