File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
csharp/ql/test/library-tests/dataflow/external-models Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,15 @@ module TaintConfig implements DataFlow::ConfigSig {
21
21
module Taint = TaintTracking:: Global< TaintConfig > ;
22
22
23
23
/**
24
- * Simulate that methods with summaries are not included in the source code.
25
- * This is relevant for dataflow analysis using summaries tagged as generated.
24
+ * Emulate that methods with summaries do not have a body.
25
+ * This is relevant for dataflow analysis using summaries with a generated like
26
+ * provenance as generated summaries are only applied, if a
27
+ * callable does not have a body.
26
28
*/
27
- private class MyMethod extends Method {
28
- override predicate fromSource ( ) { none ( ) }
29
+ private class MixedFlowArgs extends Method {
30
+ MixedFlowArgs ( ) { this .hasFullyQualifiedName ( "My.Qltest" , "G" , "MixedFlowArgs" ) }
31
+
32
+ override predicate hasBody ( ) { none ( ) }
29
33
}
30
34
31
35
from Taint:: PathNode source , Taint:: PathNode sink
Original file line number Diff line number Diff line change @@ -6,6 +6,22 @@ import semmle.code.csharp.dataflow.FlowSummary
6
6
import semmle.code.csharp.dataflow.internal.DataFlowDispatch as DataFlowDispatch
7
7
import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
8
8
9
+ /**
10
+ * Emulate that methods with summaries do not have a body.
11
+ * This is relevant for dataflow analysis using summaries with a generated like
12
+ * provenance as generated summaries are only applied, if a
13
+ * callable does not have a body.
14
+ */
15
+ private class StepArgQualGenerated extends Method {
16
+ StepArgQualGenerated ( ) {
17
+ exists ( string name |
18
+ this .hasFullyQualifiedName ( "My.Qltest" , "C" , name ) and name .matches ( "StepArgQualGenerated%" )
19
+ )
20
+ }
21
+
22
+ override predicate hasBody ( ) { none ( ) }
23
+ }
24
+
9
25
query predicate summaryThroughStep (
10
26
DataFlow:: Node node1 , DataFlow:: Node node2 , boolean preservesValue
11
27
) {
You can’t perform that action at this time.
0 commit comments