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 {
838
838
// Subclassing a node
839
839
lbl = Label:: subclass ( ) and
840
840
exists ( PY:: ClassExpr clsExpr , DataFlow:: Node superclass | pred .flowsTo ( superclass ) |
841
+ exists ( clsExpr .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and
841
842
clsExpr .getABase ( ) = superclass .asExpr ( ) and
842
843
// Potentially a class decorator could do anything, but we assume they are
843
844
// "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
36
36
class LocalSourceNode extends Node {
37
37
cached
38
38
LocalSourceNode ( ) {
39
+ exists ( this .getLocation ( ) .getFile ( ) .getRelativePath ( ) ) and (
39
40
Stages:: DataFlow:: ref ( ) and
40
41
this instanceof ExprNode and
41
42
not simpleLocalFlowStepForTypetracking ( _, this )
@@ -72,6 +73,7 @@ class LocalSourceNode extends Node {
72
73
// We include all scope entry definitions, as these act as the local source within the scope they
73
74
// enter.
74
75
this .asCfgNode ( ) = any ( ScopeEntryDefinition def ) .getDefiningNode ( )
76
+ )
75
77
}
76
78
77
79
/** 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