Skip to content

Commit c5f54e9

Browse files
committed
Ruby: Adapt to changes in FlowSummaryImpl
1 parent bce9e1f commit c5f54e9

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

ruby/ql/lib/codeql/ruby/dataflow/FlowSummary.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ deprecated class SummaryComponentStack = Impl::Private::SummaryComponentStack;
2323

2424
deprecated module SummaryComponentStack = Impl::Private::SummaryComponentStack;
2525

26+
class Provenance = Impl::Public::Provenance;
27+
2628
/** A callable with a flow summary, identified by a unique string. */
2729
abstract class SummarizedCallable extends LibraryCallable, Impl::Public::SummarizedCallable {
2830
bindingset[this]
@@ -32,13 +34,16 @@ abstract class SummarizedCallable extends LibraryCallable, Impl::Public::Summari
3234
* DEPRECATED: Use `propagatesFlow` instead.
3335
*/
3436
deprecated predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
35-
this.propagatesFlow(input, output, preservesValue, _)
37+
this.propagatesFlow(input, output, preservesValue, _, _, _)
3638
}
3739

3840
override predicate propagatesFlow(
39-
string input, string output, boolean preservesValue, string model
41+
string input, string output, boolean preservesValue, Provenance p, boolean isExact, string model
4042
) {
41-
this.propagatesFlow(input, output, preservesValue) and model = ""
43+
this.propagatesFlow(input, output, preservesValue) and
44+
p = "manual" and
45+
isExact = true and
46+
model = ""
4247
}
4348

4449
/**
@@ -114,7 +119,8 @@ private module LibraryCallbackSummaries {
114119
}
115120

116121
override predicate propagatesFlow(
117-
string input, string output, boolean preservesValue, string model
122+
string input, string output, boolean preservesValue, Provenance p, boolean isExact,
123+
string model
118124
) {
119125
(
120126
input = "Argument[block]" and
@@ -127,6 +133,8 @@ private module LibraryCallbackSummaries {
127133
)
128134
) and
129135
preservesValue = true and
136+
p = "hq-generated" and
137+
isExact = true and
130138
model = "heuristic-callback"
131139
}
132140
}

ruby/ql/lib/codeql/ruby/frameworks/data/ModelsAsData.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ private class SummarizedCallableFromModel extends SummarizedCallable {
4949
}
5050

5151
override predicate propagatesFlow(
52-
string input, string output, boolean preservesValue, string model
52+
string input, string output, boolean preservesValue, Provenance p, boolean isExact, string model
5353
) {
54-
exists(string kind | ModelOutput::relevantSummaryModel(type, path, input, output, kind, model) |
54+
exists(string kind |
55+
ModelOutput::relevantSummaryModel(type, path, input, output, kind, model) and
56+
p = "manual" and
57+
isExact = true
58+
|
5559
kind = "value" and
5660
preservesValue = true
5761
or

ruby/ql/lib/codeql/ruby/typetracking/internal/TypeTrackingImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private module SummaryTypeTrackerInput implements SummaryTypeTracker::Input {
223223
predicate propagatesFlow(
224224
SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue
225225
) {
226-
super.propagatesFlow(input, output, preservesValue, _)
226+
super.propagatesFlow(input, output, preservesValue, _, _, _)
227227
}
228228
}
229229

0 commit comments

Comments
 (0)