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