Skip to content

Commit 2dc35c1

Browse files
committed
Java/Ruby: Sync files.
1 parent a8556f4 commit 2dc35c1

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ module Public {
219219
*/
220220
pragma[nomagic]
221221
predicate clearsContent(ParameterPosition pos, ContentSet content) { none() }
222+
223+
/**
224+
* Gets whether the summary is auto generated or not.
225+
*/
226+
boolean isAutoGenerated() { result = false }
222227
}
223228
}
224229

@@ -898,6 +903,8 @@ module Private {
898903
kind = "taint" and preservesValue = false
899904
)
900905
}
906+
907+
override boolean isAutoGenerated() { summaryElement(this, _, _, _, result) }
901908
}
902909

903910
/** Holds if component `c` of specification `spec` cannot be parsed. */
@@ -1052,9 +1059,15 @@ module Private {
10521059
preservesValue = false and result = "taint"
10531060
}
10541061

1062+
private string renderGenerated(boolean generated) {
1063+
generated = true and result = "generated:"
1064+
or
1065+
generated = false and result = ""
1066+
}
1067+
10551068
/**
10561069
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
1057-
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1070+
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;(generated:)?kind",
10581071
* ext is hardcoded to empty.
10591072
*/
10601073
query predicate summary(string csv) {
@@ -1065,7 +1078,7 @@ module Private {
10651078
c.relevantSummary(input, output, preservesValue) and
10661079
csv =
10671080
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
1068-
";" + renderKind(preservesValue)
1081+
";" + renderGenerated(c.isAutoGenerated()) + renderKind(preservesValue)
10691082
)
10701083
}
10711084
}

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ module Public {
219219
*/
220220
pragma[nomagic]
221221
predicate clearsContent(ParameterPosition pos, ContentSet content) { none() }
222+
223+
/**
224+
* Gets whether the summary is auto generated or not.
225+
*/
226+
boolean isAutoGenerated() { result = false }
222227
}
223228
}
224229

@@ -898,6 +903,8 @@ module Private {
898903
kind = "taint" and preservesValue = false
899904
)
900905
}
906+
907+
override boolean isAutoGenerated() { summaryElement(this, _, _, _, result) }
901908
}
902909

903910
/** Holds if component `c` of specification `spec` cannot be parsed. */
@@ -1052,9 +1059,15 @@ module Private {
10521059
preservesValue = false and result = "taint"
10531060
}
10541061

1062+
private string renderGenerated(boolean generated) {
1063+
generated = true and result = "generated:"
1064+
or
1065+
generated = false and result = ""
1066+
}
1067+
10551068
/**
10561069
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
1057-
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1070+
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;(generated:)?kind",
10581071
* ext is hardcoded to empty.
10591072
*/
10601073
query predicate summary(string csv) {
@@ -1065,7 +1078,7 @@ module Private {
10651078
c.relevantSummary(input, output, preservesValue) and
10661079
csv =
10671080
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
1068-
";" + renderKind(preservesValue)
1081+
";" + renderGenerated(c.isAutoGenerated()) + renderKind(preservesValue)
10691082
)
10701083
}
10711084
}

0 commit comments

Comments
 (0)