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 {
2323 or
2424 not n instanceof FlowSummaryNode and
2525 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+ )
2732 or
2833 result .asSummarizedCallable ( ) = n .( FlowSummaryNode ) .getSummarizedCallable ( )
2934 }
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ class DataFlowLocation = Location;
256256private newtype TDataFlowCallable =
257257 TCallable ( Callable c ) or
258258 TFileScope ( File f ) or
259+ TExternalFileScope ( ) or
259260 TSummarizedCallable ( FlowSummary:: SummarizedCallable c )
260261
261262class DataFlowCallable extends TDataFlowCallable {
@@ -269,6 +270,11 @@ class DataFlowCallable extends TDataFlowCallable {
269270 */
270271 File asFileScope ( ) { this = TFileScope ( result ) }
271272
273+ /**
274+ * Holds if this `DataFlowCallable` is an external file scope.
275+ */
276+ predicate isExternalFileScope ( ) { this = TExternalFileScope ( ) }
277+
272278 /**
273279 * Gets the `SummarizedCallable` corresponding to this `DataFlowCallable`, if any.
274280 */
You can’t perform that action at this time.
0 commit comments