File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
python/ql/lib/semmle/python Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -838,6 +838,7 @@ module API {
838838 // Subclassing a node
839839 lbl = Label:: subclass ( ) and
840840 exists ( PY:: ClassExpr clsExpr , DataFlow:: Node superclass | pred .flowsTo ( superclass ) |
841+ exists ( clsExpr .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
841842 clsExpr .getABase ( ) = superclass .asExpr ( ) and
842843 // Potentially a class decorator could do anything, but we assume they are
843844 // "benign" and let subclasses edges flow through anyway.
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ private import semmle.python.dataflow.new.internal.ImportStar
3636class LocalSourceNode extends Node {
3737 cached
3838 LocalSourceNode ( ) {
39+ exists ( this .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and (
3940 Stages:: DataFlow:: ref ( ) and
4041 this instanceof ExprNode and
4142 not simpleLocalFlowStepForTypetracking ( _, this )
@@ -72,6 +73,7 @@ class LocalSourceNode extends Node {
7273 // We include all scope entry definitions, as these act as the local source within the scope they
7374 // enter.
7475 this .asCfgNode ( ) = any ( ScopeEntryDefinition def ) .getDefiningNode ( )
76+ )
7577 }
7678
7779 /** Holds if this `LocalSourceNode` can flow to `nodeTo` in one or more local flow steps. */
You can’t perform that action at this time.
0 commit comments