Skip to content

Commit ea173f9

Browse files
committed
Sync files.
1 parent 7422029 commit ea173f9

File tree

5 files changed

+85
-80
lines changed

5 files changed

+85
-80
lines changed

go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,19 @@ module Public {
241241
}
242242

243243
/**
244-
* Holds if the summary is auto generated and not manually generated.
244+
* Holds if the summaries that apply to `this` are auto generated and not manually generated.
245245
*/
246-
predicate isAutoGenerated() { none() }
246+
final predicate isAutoGenerated() { this.hasProvenance("generated") and not this.isManual() }
247247

248248
/**
249-
* Holds if the summary has the given provenance where `true` is
250-
* `generated` and `false` is `manual`.
249+
* Holds if there exists a manual summary that applies to `this`.
251250
*/
252-
predicate hasProvenance(boolean generated) { none() }
251+
final predicate isManual() { this.hasProvenance("manual") }
252+
253+
/**
254+
* Holds if there exists a summary that applies to `this` that has provenance `provenance`.
255+
*/
256+
predicate hasProvenance(string provenance) { none() }
253257
}
254258

255259
/** A callable where there is no flow via the callable. */
@@ -259,13 +263,12 @@ module Public {
259263
/**
260264
* Holds if the neutral is auto generated.
261265
*/
262-
predicate isAutoGenerated() { neutralElement(this, true) }
266+
predicate isAutoGenerated() { neutralElement(this, "generated") }
263267

264268
/**
265-
* Holds if the neutral has the given provenance where `true` is
266-
* `generated` and `false` is `manual`.
269+
* Holds if the neutral has provenance `provenance`.
267270
*/
268-
predicate hasProvenance(boolean generated) { neutralElement(this, generated) }
271+
predicate hasProvenance(string provenance) { neutralElement(this, provenance) }
269272
}
270273
}
271274

@@ -997,12 +1000,12 @@ module Private {
9971000
private predicate relevantSummaryElementGenerated(
9981001
AccessPath inSpec, AccessPath outSpec, string kind
9991002
) {
1000-
summaryElement(this, inSpec, outSpec, kind, true) and
1001-
not summaryElement(this, _, _, _, false)
1003+
summaryElement(this, inSpec, outSpec, kind, "generated") and
1004+
not summaryElement(this, _, _, _, "manual")
10021005
}
10031006

10041007
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
1005-
summaryElement(this, inSpec, outSpec, kind, false)
1008+
summaryElement(this, inSpec, outSpec, kind, "manual")
10061009
or
10071010
this.relevantSummaryElementGenerated(inSpec, outSpec, kind)
10081011
}
@@ -1021,10 +1024,8 @@ module Private {
10211024
)
10221025
}
10231026

1024-
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
1025-
1026-
override predicate hasProvenance(boolean generated) {
1027-
summaryElement(this, _, _, _, generated)
1027+
override predicate hasProvenance(string provenance) {
1028+
summaryElement(this, _, _, _, provenance)
10281029
}
10291030
}
10301031

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,19 @@ module Public {
241241
}
242242

243243
/**
244-
* Holds if the summary is auto generated and not manually generated.
244+
* Holds if the summaries that apply to `this` are auto generated and not manually generated.
245245
*/
246-
predicate isAutoGenerated() { none() }
246+
final predicate isAutoGenerated() { this.hasProvenance("generated") and not this.isManual() }
247247

248248
/**
249-
* Holds if the summary has the given provenance where `true` is
250-
* `generated` and `false` is `manual`.
249+
* Holds if there exists a manual summary that applies to `this`.
251250
*/
252-
predicate hasProvenance(boolean generated) { none() }
251+
final predicate isManual() { this.hasProvenance("manual") }
252+
253+
/**
254+
* Holds if there exists a summary that applies to `this` that has provenance `provenance`.
255+
*/
256+
predicate hasProvenance(string provenance) { none() }
253257
}
254258

255259
/** A callable where there is no flow via the callable. */
@@ -259,13 +263,12 @@ module Public {
259263
/**
260264
* Holds if the neutral is auto generated.
261265
*/
262-
predicate isAutoGenerated() { neutralElement(this, true) }
266+
predicate isAutoGenerated() { neutralElement(this, "generated") }
263267

264268
/**
265-
* Holds if the neutral has the given provenance where `true` is
266-
* `generated` and `false` is `manual`.
269+
* Holds if the neutral has provenance `provenance`.
267270
*/
268-
predicate hasProvenance(boolean generated) { neutralElement(this, generated) }
271+
predicate hasProvenance(string provenance) { neutralElement(this, provenance) }
269272
}
270273
}
271274

@@ -997,12 +1000,12 @@ module Private {
9971000
private predicate relevantSummaryElementGenerated(
9981001
AccessPath inSpec, AccessPath outSpec, string kind
9991002
) {
1000-
summaryElement(this, inSpec, outSpec, kind, true) and
1001-
not summaryElement(this, _, _, _, false)
1003+
summaryElement(this, inSpec, outSpec, kind, "generated") and
1004+
not summaryElement(this, _, _, _, "manual")
10021005
}
10031006

10041007
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
1005-
summaryElement(this, inSpec, outSpec, kind, false)
1008+
summaryElement(this, inSpec, outSpec, kind, "manual")
10061009
or
10071010
this.relevantSummaryElementGenerated(inSpec, outSpec, kind)
10081011
}
@@ -1021,10 +1024,8 @@ module Private {
10211024
)
10221025
}
10231026

1024-
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
1025-
1026-
override predicate hasProvenance(boolean generated) {
1027-
summaryElement(this, _, _, _, generated)
1027+
override predicate hasProvenance(string provenance) {
1028+
summaryElement(this, _, _, _, provenance)
10281029
}
10291030
}
10301031

python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,19 @@ module Public {
241241
}
242242

243243
/**
244-
* Holds if the summary is auto generated and not manually generated.
244+
* Holds if the summaries that apply to `this` are auto generated and not manually generated.
245245
*/
246-
predicate isAutoGenerated() { none() }
246+
final predicate isAutoGenerated() { this.hasProvenance("generated") and not this.isManual() }
247247

248248
/**
249-
* Holds if the summary has the given provenance where `true` is
250-
* `generated` and `false` is `manual`.
249+
* Holds if there exists a manual summary that applies to `this`.
251250
*/
252-
predicate hasProvenance(boolean generated) { none() }
251+
final predicate isManual() { this.hasProvenance("manual") }
252+
253+
/**
254+
* Holds if there exists a summary that applies to `this` that has provenance `provenance`.
255+
*/
256+
predicate hasProvenance(string provenance) { none() }
253257
}
254258

255259
/** A callable where there is no flow via the callable. */
@@ -259,13 +263,12 @@ module Public {
259263
/**
260264
* Holds if the neutral is auto generated.
261265
*/
262-
predicate isAutoGenerated() { neutralElement(this, true) }
266+
predicate isAutoGenerated() { neutralElement(this, "generated") }
263267

264268
/**
265-
* Holds if the neutral has the given provenance where `true` is
266-
* `generated` and `false` is `manual`.
269+
* Holds if the neutral has provenance `provenance`.
267270
*/
268-
predicate hasProvenance(boolean generated) { neutralElement(this, generated) }
271+
predicate hasProvenance(string provenance) { neutralElement(this, provenance) }
269272
}
270273
}
271274

@@ -997,12 +1000,12 @@ module Private {
9971000
private predicate relevantSummaryElementGenerated(
9981001
AccessPath inSpec, AccessPath outSpec, string kind
9991002
) {
1000-
summaryElement(this, inSpec, outSpec, kind, true) and
1001-
not summaryElement(this, _, _, _, false)
1003+
summaryElement(this, inSpec, outSpec, kind, "generated") and
1004+
not summaryElement(this, _, _, _, "manual")
10021005
}
10031006

10041007
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
1005-
summaryElement(this, inSpec, outSpec, kind, false)
1008+
summaryElement(this, inSpec, outSpec, kind, "manual")
10061009
or
10071010
this.relevantSummaryElementGenerated(inSpec, outSpec, kind)
10081011
}
@@ -1021,10 +1024,8 @@ module Private {
10211024
)
10221025
}
10231026

1024-
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
1025-
1026-
override predicate hasProvenance(boolean generated) {
1027-
summaryElement(this, _, _, _, generated)
1027+
override predicate hasProvenance(string provenance) {
1028+
summaryElement(this, _, _, _, provenance)
10281029
}
10291030
}
10301031

ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,19 @@ module Public {
241241
}
242242

243243
/**
244-
* Holds if the summary is auto generated and not manually generated.
244+
* Holds if the summaries that apply to `this` are auto generated and not manually generated.
245245
*/
246-
predicate isAutoGenerated() { none() }
246+
final predicate isAutoGenerated() { this.hasProvenance("generated") and not this.isManual() }
247247

248248
/**
249-
* Holds if the summary has the given provenance where `true` is
250-
* `generated` and `false` is `manual`.
249+
* Holds if there exists a manual summary that applies to `this`.
251250
*/
252-
predicate hasProvenance(boolean generated) { none() }
251+
final predicate isManual() { this.hasProvenance("manual") }
252+
253+
/**
254+
* Holds if there exists a summary that applies to `this` that has provenance `provenance`.
255+
*/
256+
predicate hasProvenance(string provenance) { none() }
253257
}
254258

255259
/** A callable where there is no flow via the callable. */
@@ -259,13 +263,12 @@ module Public {
259263
/**
260264
* Holds if the neutral is auto generated.
261265
*/
262-
predicate isAutoGenerated() { neutralElement(this, true) }
266+
predicate isAutoGenerated() { neutralElement(this, "generated") }
263267

264268
/**
265-
* Holds if the neutral has the given provenance where `true` is
266-
* `generated` and `false` is `manual`.
269+
* Holds if the neutral has provenance `provenance`.
267270
*/
268-
predicate hasProvenance(boolean generated) { neutralElement(this, generated) }
271+
predicate hasProvenance(string provenance) { neutralElement(this, provenance) }
269272
}
270273
}
271274

@@ -997,12 +1000,12 @@ module Private {
9971000
private predicate relevantSummaryElementGenerated(
9981001
AccessPath inSpec, AccessPath outSpec, string kind
9991002
) {
1000-
summaryElement(this, inSpec, outSpec, kind, true) and
1001-
not summaryElement(this, _, _, _, false)
1003+
summaryElement(this, inSpec, outSpec, kind, "generated") and
1004+
not summaryElement(this, _, _, _, "manual")
10021005
}
10031006

10041007
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
1005-
summaryElement(this, inSpec, outSpec, kind, false)
1008+
summaryElement(this, inSpec, outSpec, kind, "manual")
10061009
or
10071010
this.relevantSummaryElementGenerated(inSpec, outSpec, kind)
10081011
}
@@ -1021,10 +1024,8 @@ module Private {
10211024
)
10221025
}
10231026

1024-
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
1025-
1026-
override predicate hasProvenance(boolean generated) {
1027-
summaryElement(this, _, _, _, generated)
1027+
override predicate hasProvenance(string provenance) {
1028+
summaryElement(this, _, _, _, provenance)
10281029
}
10291030
}
10301031

swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,19 @@ module Public {
241241
}
242242

243243
/**
244-
* Holds if the summary is auto generated and not manually generated.
244+
* Holds if the summaries that apply to `this` are auto generated and not manually generated.
245245
*/
246-
predicate isAutoGenerated() { none() }
246+
final predicate isAutoGenerated() { this.hasProvenance("generated") and not this.isManual() }
247247

248248
/**
249-
* Holds if the summary has the given provenance where `true` is
250-
* `generated` and `false` is `manual`.
249+
* Holds if there exists a manual summary that applies to `this`.
251250
*/
252-
predicate hasProvenance(boolean generated) { none() }
251+
final predicate isManual() { this.hasProvenance("manual") }
252+
253+
/**
254+
* Holds if there exists a summary that applies to `this` that has provenance `provenance`.
255+
*/
256+
predicate hasProvenance(string provenance) { none() }
253257
}
254258

255259
/** A callable where there is no flow via the callable. */
@@ -259,13 +263,12 @@ module Public {
259263
/**
260264
* Holds if the neutral is auto generated.
261265
*/
262-
predicate isAutoGenerated() { neutralElement(this, true) }
266+
predicate isAutoGenerated() { neutralElement(this, "generated") }
263267

264268
/**
265-
* Holds if the neutral has the given provenance where `true` is
266-
* `generated` and `false` is `manual`.
269+
* Holds if the neutral has provenance `provenance`.
267270
*/
268-
predicate hasProvenance(boolean generated) { neutralElement(this, generated) }
271+
predicate hasProvenance(string provenance) { neutralElement(this, provenance) }
269272
}
270273
}
271274

@@ -997,12 +1000,12 @@ module Private {
9971000
private predicate relevantSummaryElementGenerated(
9981001
AccessPath inSpec, AccessPath outSpec, string kind
9991002
) {
1000-
summaryElement(this, inSpec, outSpec, kind, true) and
1001-
not summaryElement(this, _, _, _, false)
1003+
summaryElement(this, inSpec, outSpec, kind, "generated") and
1004+
not summaryElement(this, _, _, _, "manual")
10021005
}
10031006

10041007
private predicate relevantSummaryElement(AccessPath inSpec, AccessPath outSpec, string kind) {
1005-
summaryElement(this, inSpec, outSpec, kind, false)
1008+
summaryElement(this, inSpec, outSpec, kind, "manual")
10061009
or
10071010
this.relevantSummaryElementGenerated(inSpec, outSpec, kind)
10081011
}
@@ -1021,10 +1024,8 @@ module Private {
10211024
)
10221025
}
10231026

1024-
override predicate isAutoGenerated() { this.relevantSummaryElementGenerated(_, _, _) }
1025-
1026-
override predicate hasProvenance(boolean generated) {
1027-
summaryElement(this, _, _, _, generated)
1027+
override predicate hasProvenance(string provenance) {
1028+
summaryElement(this, _, _, _, provenance)
10281029
}
10291030
}
10301031

0 commit comments

Comments
 (0)