@@ -69,39 +69,37 @@ abstract class SummarizedCallable extends LibraryCallable, Impl::Public::Summari
6969}
7070
7171class RequiredSummaryComponentStack = Impl:: Public:: RequiredSummaryComponentStack ;
72- // // This gives access to getNodeFromPath, which is not constrained to `CallNode`s
73- // // as `resolvedSummaryBase` is.
74- // private import semmle.python.frameworks.data.internal.ApiGraphModels as AGM
75- //
76- // private class SummarizedCallableFromModel extends SummarizedCallable {
77- // string package;
78- // string type;
79- // string path;
80- // SummarizedCallableFromModel() {
81- // ModelOutput::relevantSummaryModel(package, type, path, _, _, _) and
82- // this = package + ";" + type + ";" + path
83- // }
84- // override CallCfgNode getACall() {
85- // exists(API::CallNode base |
86- // ModelOutput::resolvedSummaryBase(package, type, path, base) and
87- // result = base.getACall()
88- // )
89- // }
90- // override ArgumentNode getACallback() {
91- // exists(API::Node base |
92- // base = AGM::getNodeFromPath(package, type, path) and
93- // result = base.getAValueReachableFromSource()
94- // )
95- // }
96- // override predicate propagatesFlowExt(string input, string output, boolean preservesValue) {
97- // exists(string kind |
98- // ModelOutput::relevantSummaryModel(package, type, path, input, output, kind)
99- // |
100- // kind = "value" and
101- // preservesValue = true
102- // or
103- // kind = "taint" and
104- // preservesValue = false
105- // )
106- // }
107- // }
72+
73+ private class SummarizedCallableFromModel extends SummarizedCallable {
74+ string type ;
75+ string path ;
76+
77+ SummarizedCallableFromModel ( ) {
78+ ModelOutput:: relevantSummaryModel ( type , path , _, _, _) and
79+ this = type + ";" + path
80+ }
81+
82+ override CallCfgNode getACall ( ) {
83+ exists ( API:: CallNode base |
84+ ModelOutput:: resolvedSummaryBase ( type , path , base ) and
85+ result = base .getACall ( )
86+ )
87+ }
88+
89+ override ArgumentNode getACallback ( ) {
90+ exists ( API:: Node base |
91+ ModelOutput:: resolvedSummaryRefBase ( type , path , base ) and
92+ result = base .getAValueReachableFromSource ( )
93+ )
94+ }
95+
96+ override predicate propagatesFlowExt ( string input , string output , boolean preservesValue ) {
97+ exists ( string kind | ModelOutput:: relevantSummaryModel ( type , path , input , output , kind ) |
98+ kind = "value" and
99+ preservesValue = true
100+ or
101+ kind = "taint" and
102+ preservesValue = false
103+ )
104+ }
105+ }
0 commit comments