Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 649757c

Browse files
committed
Java/Ruby: Sync files.
1 parent 38c6bf5 commit 649757c

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,13 +1116,13 @@ module Private {
11161116
preservesValue = false and result = "taint"
11171117
}
11181118

1119-
private string renderGenerated(RelevantSummarizedCallable c) {
1120-
if c.(SummarizedCallable).isAutoGenerated() then result = "generated:" else result = ""
1119+
private string renderProvenance(RelevantSummarizedCallable c) {
1120+
if c.(SummarizedCallable).isAutoGenerated() then result = "generated" else result = "manual"
11211121
}
11221122

11231123
/**
11241124
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
1125-
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;(generated:)?kind",
1125+
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind;provenance"",
11261126
* ext is hardcoded to empty.
11271127
*/
11281128
query predicate summary(string csv) {
@@ -1133,7 +1133,7 @@ module Private {
11331133
c.relevantSummary(input, output, preservesValue) and
11341134
csv =
11351135
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
1136-
";" + renderGenerated(c) + renderKind(preservesValue)
1136+
";" + renderKind(preservesValue) + ";" + renderProvenance(c)
11371137
)
11381138
}
11391139
}

java/ql/src/utils/model-generator/internal/CaptureModels.qll

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ private string asSummaryModel(TargetApi api, string input, string output, string
4444
result =
4545
asPartialModel(api) + input + ";" //
4646
+ output + ";" //
47-
+ "generated:" + kind
47+
+ kind + ";" //
48+
+ "generated"
4849
}
4950

5051
/**
@@ -68,15 +69,21 @@ private string asTaintModel(TargetApi api, string input, string output) {
6869
*/
6970
bindingset[input, kind]
7071
private string asSinkModel(TargetApi api, string input, string kind) {
71-
result = asPartialModel(api) + input + ";" + "generated:" + kind
72+
result =
73+
asPartialModel(api) + input + ";" //
74+
+ kind + ";" //
75+
+ "generated"
7276
}
7377

7478
/**
7579
* Gets the source model for `api` with `output` and `kind`.
7680
*/
7781
bindingset[output, kind]
7882
private string asSourceModel(TargetApi api, string output, string kind) {
79-
result = asPartialModel(api) + output + ";" + "generated:" + kind
83+
result =
84+
asPartialModel(api) + output + ";" //
85+
+ kind + ";" //
86+
+ "generated"
8087
}
8188

8289
/**

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,13 +1116,13 @@ module Private {
11161116
preservesValue = false and result = "taint"
11171117
}
11181118

1119-
private string renderGenerated(RelevantSummarizedCallable c) {
1120-
if c.(SummarizedCallable).isAutoGenerated() then result = "generated:" else result = ""
1119+
private string renderProvenance(RelevantSummarizedCallable c) {
1120+
if c.(SummarizedCallable).isAutoGenerated() then result = "generated" else result = "manual"
11211121
}
11221122

11231123
/**
11241124
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
1125-
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;(generated:)?kind",
1125+
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind;provenance"",
11261126
* ext is hardcoded to empty.
11271127
*/
11281128
query predicate summary(string csv) {
@@ -1133,7 +1133,7 @@ module Private {
11331133
c.relevantSummary(input, output, preservesValue) and
11341134
csv =
11351135
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
1136-
";" + renderGenerated(c) + renderKind(preservesValue)
1136+
";" + renderKind(preservesValue) + ";" + renderProvenance(c)
11371137
)
11381138
}
11391139
}

0 commit comments

Comments
 (0)