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 {
2121module Taint = TaintTracking:: Global< TaintConfig > ;
2222
2323/**
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.
2628 */
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 ( ) }
2933}
3034
3135from 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
66import semmle.code.csharp.dataflow.internal.DataFlowDispatch as DataFlowDispatch
77import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
88
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+
925query predicate summaryThroughStep (
1026 DataFlow:: Node node1 , DataFlow:: Node node2 , boolean preservesValue
1127) {
You can’t perform that action at this time.
0 commit comments