Skip to content

Commit 62148a3

Browse files
committed
Python: Adapt to changes in FlowSummaryImpl
1 parent 81c6b77 commit 62148a3

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

python/ql/lib/semmle/python/dataflow/new/FlowSummary.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ deprecated class SummaryComponentStack = Impl::Private::SummaryComponentStack;
2222

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

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

3739
override predicate propagatesFlow(
38-
string input, string output, boolean preservesValue, string model
40+
string input, string output, boolean preservesValue, Provenance p, boolean isExact, string model
3941
) {
40-
this.propagatesFlow(input, output, preservesValue) and model = this
42+
this.propagatesFlow(input, output, preservesValue) and
43+
p = "manual" and
44+
isExact = true and
45+
model = this
4146
}
4247

4348
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private module SummaryTypeTrackerInput implements SummaryTypeTracker::Input {
3030
predicate propagatesFlow(
3131
SummaryComponentStack input, SummaryComponentStack output, boolean preservesValue
3232
) {
33-
super.propagatesFlow(input, output, preservesValue, _)
33+
super.propagatesFlow(input, output, preservesValue, _, _, _)
3434
}
3535
}
3636

python/ql/lib/semmle/python/frameworks/data/ModelsAsData.qll

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ private class ThreatModelSourceFromDataExtension extends ThreatModelSource::Rang
3636
private class SummarizedCallableFromModel extends SummarizedCallable {
3737
string type;
3838
string path;
39+
string input_;
40+
string output_;
41+
string kind;
42+
string model_;
3943

4044
SummarizedCallableFromModel() {
41-
ModelOutput::relevantSummaryModel(type, path, _, _, _, _) and
45+
ModelOutput::relevantSummaryModel(type, path, input_, output_, kind, model_) and
4246
this = type + ";" + path
4347
}
4448

@@ -52,14 +56,13 @@ private class SummarizedCallableFromModel extends SummarizedCallable {
5256
}
5357

5458
override predicate propagatesFlow(
55-
string input, string output, boolean preservesValue, string model
59+
string input, string output, boolean preservesValue, Provenance p, boolean isExact, string model
5660
) {
57-
exists(string kind | ModelOutput::relevantSummaryModel(type, path, input, output, kind, model) |
58-
kind = "value" and
59-
preservesValue = true
60-
or
61-
kind = "taint" and
62-
preservesValue = false
63-
)
61+
input = input_ and
62+
output = output_ and
63+
(if kind = "value" then preservesValue = true else preservesValue = false) and
64+
p = "manual" and
65+
isExact = true and
66+
model = model_
6467
}
6568
}

0 commit comments

Comments
 (0)