Skip to content

Commit 62fc1b6

Browse files
committed
C#: Adjust the model generator to produce kinds for neutrals.
1 parent d62a552 commit 62fc1b6

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,11 @@ module SummaryComponentStack {
111111
}
112112

113113
/**
114-
* DEPRECATED: Use the member predicate `getAccessPath` instead.
114+
* DEPRECATED: Use the member predicate `getMadRepresentation` instead.
115115
*
116116
* Gets a textual representation of this stack used for flow summaries.
117117
*/
118-
deprecated string getComponentStack(SummaryComponentStack s) { result = s.getAccessPath() }
118+
deprecated string getComponentStack(SummaryComponentStack s) { result = s.getMadRepresentation() }
119119
}
120120

121121
class SummarizedCallable = Impl::Public::SummarizedCallable;

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module Public {
2323
* content type, or a return kind.
2424
*/
2525
class SummaryComponent extends TSummaryComponent {
26-
/** Gets a textual representation of this component used for flow summaries. */
27-
string getAccessStep() {
28-
result = getAccessStepSpecific(this)
26+
/** Gets a textual representation of this component used for MaD models. */
27+
string getMadRepresentation() {
28+
result = getMadRepresentationSpecific(this)
2929
or
3030
exists(ArgumentPosition pos |
3131
this = TParameterSummaryComponent(pos) and
@@ -46,7 +46,7 @@ module Public {
4646
}
4747

4848
/** Gets a textual representation of this summary component. */
49-
string toString() { result = this.getAccessStep() }
49+
string toString() { result = this.getMadRepresentation() }
5050
}
5151

5252
/** Provides predicates for constructing summary components. */
@@ -127,21 +127,21 @@ module Public {
127127
}
128128

129129
/** Gets a textual representation of this stack used for MaD models. */
130-
string getAccessPath() {
130+
string getMadRepresentation() {
131131
exists(SummaryComponent head, SummaryComponentStack tail |
132132
head = this.head() and
133133
tail = this.tail() and
134-
result = tail.getAccessPath() + "." + head.getAccessStep()
134+
result = tail.getMadRepresentation() + "." + head.getMadRepresentation()
135135
)
136136
or
137137
exists(SummaryComponent c |
138138
this = TSingletonSummaryComponentStack(c) and
139-
result = c.getAccessStep()
139+
result = c.getMadRepresentation()
140140
)
141141
}
142142

143143
/** Gets a textual representation of this stack. */
144-
string toString() { result = this.getAccessPath() }
144+
string toString() { result = this.getMadRepresentation() }
145145
}
146146

147147
/** Provides predicates for constructing stacks of summary components. */
@@ -1350,8 +1350,8 @@ module Private {
13501350
c.relevantSummary(input, output, preservesValue) and
13511351
csv =
13521352
c.getCallableCsv() // Callable information
1353-
+ input.getAccessPath() + ";" // input
1354-
+ output.getAccessPath() + ";" // output
1353+
+ input.getMadRepresentation() + ";" // input
1354+
+ output.getMadRepresentation() + ";" // output
13551355
+ renderKind(preservesValue) + ";" // kind
13561356
+ renderProvenance(c) // provenance
13571357
)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ SummaryComponent interpretComponentSpecific(AccessPathToken c) {
186186
)
187187
}
188188

189-
/** Gets the textual representation of the content in the format used for flow summaries. */
189+
/** Gets the textual representation of the content in the format used MaD models. */
190190
private string getContentSpecific(Content c) {
191191
c = TElementContent() and result = "Element"
192192
or
@@ -197,8 +197,8 @@ private string getContentSpecific(Content c) {
197197
exists(SyntheticField f | c = TSyntheticFieldContent(f) and result = "SyntheticField[" + f + "]")
198198
}
199199

200-
/** Gets the textual representation of a summary component in the format used for flow summaries. */
201-
string getAccessStepSpecific(SummaryComponent sc) {
200+
/** Gets the textual representation of a summary component in the format used for MaD models. */
201+
string getMadRepresentationSpecific(SummaryComponent sc) {
202202
exists(Content c | sc = TContentSummaryComponent(c) and result = getContentSpecific(c))
203203
or
204204
sc = TWithoutContentSummaryComponent(_) and result = "WithoutElement"
@@ -212,15 +212,15 @@ string getAccessStepSpecific(SummaryComponent sc) {
212212
)
213213
}
214214

215-
/** Gets the textual representation of a parameter position in the format used for flow summaries. */
215+
/** Gets the textual representation of a parameter position in the format used for MaD models. */
216216
string getParameterPosition(ParameterPosition pos) {
217217
result = pos.getPosition().toString()
218218
or
219219
pos.isThisParameter() and
220220
result = "this"
221221
}
222222

223-
/** Gets the textual representation of an argument position in the format used for flow summaries. */
223+
/** Gets the textual representation of an argument position in the format used for MaD models. */
224224
string getArgumentPosition(ArgumentPosition pos) {
225225
result = pos.getPosition().toString()
226226
or

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ module EntityFramework {
410410
) {
411411
this = dbSet.getDbContextClass() and
412412
this.output(output, mapped, dbSet) and
413-
result = dbSet.getFullName() + "#" + output.getAccessPath()
413+
result = dbSet.getFullName() + "#" + output.getMadRepresentation()
414414
}
415415
}
416416

0 commit comments

Comments
 (0)