File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
go/ql/lib/semmle/go/dataflow/internal Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,12 @@ module Private {
23
23
or
24
24
not n instanceof FlowSummaryNode and
25
25
not exists ( n .getEnclosingCallable ( ) ) and
26
- result .asFileScope ( ) = n .getFile ( )
26
+ (
27
+ result .asFileScope ( ) = n .getFile ( )
28
+ or
29
+ not exists ( n .getFile ( ) ) and
30
+ result .isExternalFileScope ( )
31
+ )
27
32
or
28
33
result .asSummarizedCallable ( ) = n .( FlowSummaryNode ) .getSummarizedCallable ( )
29
34
}
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ class DataFlowLocation = Location;
256
256
private newtype TDataFlowCallable =
257
257
TCallable ( Callable c ) or
258
258
TFileScope ( File f ) or
259
+ TExternalFileScope ( ) or
259
260
TSummarizedCallable ( FlowSummary:: SummarizedCallable c )
260
261
261
262
class DataFlowCallable extends TDataFlowCallable {
@@ -269,6 +270,11 @@ class DataFlowCallable extends TDataFlowCallable {
269
270
*/
270
271
File asFileScope ( ) { this = TFileScope ( result ) }
271
272
273
+ /**
274
+ * Holds if this `DataFlowCallable` is an external file scope.
275
+ */
276
+ predicate isExternalFileScope ( ) { this = TExternalFileScope ( ) }
277
+
272
278
/**
273
279
* Gets the `SummarizedCallable` corresponding to this `DataFlowCallable`, if any.
274
280
*/
You can’t perform that action at this time.
0 commit comments