From f141336f64286e09fe0c4645c651e7155f70e09c Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Sun, 22 May 2022 15:14:58 +0200 Subject: [PATCH] C#: Fake location of methods as we want to use the defined summaries for testing purposes. --- .../dataflow/external-models/ExternalFlow.ql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/csharp/ql/test/library-tests/dataflow/external-models/ExternalFlow.ql b/csharp/ql/test/library-tests/dataflow/external-models/ExternalFlow.ql index 316cd8ef0b7..9c570d3534b 100644 --- a/csharp/ql/test/library-tests/dataflow/external-models/ExternalFlow.ql +++ b/csharp/ql/test/library-tests/dataflow/external-models/ExternalFlow.ql @@ -53,6 +53,14 @@ class Conf extends TaintTracking::Configuration { } } +/** + * Simulate that methods with summaries are not included in the source code. + * This is relevant for dataflow analysis using summaries tagged as generated. + */ +private class MyMethod extends Method { + override predicate fromSource() { none() } +} + from DataFlow::PathNode source, DataFlow::PathNode sink, Conf conf where conf.hasFlowPath(source, sink) select sink, source, sink, "$@", source, source.toString()