Skip to content

Commit 37abdc7

Browse files
committed
C#: Adjust the implementation to use the new predicates and Provenance.
1 parent 1d82b09 commit 37abdc7

File tree

7 files changed

+7
-9
lines changed

7 files changed

+7
-9
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ module ModelValidation {
248248
not ext.regexpMatch("|Attribute") and
249249
result = "Unrecognized extra API graph element \"" + ext + "\" in " + pred + " model."
250250
or
251-
not provenance = ["manual", "generated"] and
251+
invalidProvenance(provenance) and
252252
result = "Unrecognized provenance description \"" + provenance + "\" in " + pred + " model."
253253
)
254254
}

csharp/ql/lib/semmle/code/csharp/dataflow/FlowSummary.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ private class RecordConstructorFlow extends SummarizedCallable {
137137
preservesValue = true
138138
)
139139
}
140-
141-
override predicate hasProvenance(string provenance) { provenance = "manual" }
142140
}
143141

144142
class RequiredSummaryComponentStack = Impl::Public::RequiredSummaryComponentStack;

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowDispatch.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class DataFlowSummarizedCallable instanceof FlowSummary::SummarizedCallable {
9595
DataFlowSummarizedCallable() {
9696
not this.fromSource()
9797
or
98-
this.fromSource() and not this.isAutoGenerated()
98+
this.fromSource() and not this.applyGeneratedModel()
9999
}
100100

101101
string toString() { result = super.toString() }

csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ module EntityFramework {
8686
abstract class EFSummarizedCallable extends SummarizedCallable {
8787
bindingset[this]
8888
EFSummarizedCallable() { any() }
89-
90-
override predicate hasProvenance(string provenance) { provenance = "manual" }
9189
}
9290

9391
private class DbSetAddOrUpdateRequiredSummaryComponentStack extends RequiredSummaryComponentStack {

csharp/ql/src/utils/modelgenerator/CaptureDiscardedSummaryModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ import internal.CaptureSummaryFlowQuery
1111
from DataFlowTargetApi api, string flow
1212
where
1313
flow = captureFlow(api) and
14-
api.(FlowSummaryImpl::Public::SummarizedCallable).isManual()
14+
api.(FlowSummaryImpl::Public::SummarizedCallable).applyManualModel()
1515
select flow order by flow

csharp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ import internal.CaptureSummaryFlowQuery
1313
from DataFlowTargetApi api, string noflow
1414
where
1515
noflow = captureNoFlow(api) and
16-
not api.(FlowSummaryImpl::Public::SummarizedCallable).isManual()
16+
not api.(FlowSummaryImpl::Public::SummarizedCallable).applyManualModel()
1717
select noflow order by noflow

csharp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ import internal.CaptureModels
1111
import internal.CaptureSummaryFlowQuery
1212

1313
from DataFlowTargetApi api, string flow
14-
where flow = captureFlow(api) and not api.(FlowSummaryImpl::Public::SummarizedCallable).isManual()
14+
where
15+
flow = captureFlow(api) and
16+
not api.(FlowSummaryImpl::Public::SummarizedCallable).applyManualModel()
1517
select flow order by flow

0 commit comments

Comments
 (0)