@@ -140,8 +140,23 @@ predicate modelCoverage(string package, int pkgs, string kind, string part, int
140
140
141
141
/** Provides a query predicate to check the MaD models for validation errors. */
142
142
module ModelValidation {
143
+ private import codeql.dataflow.internal.AccessPathSyntax as AccessPathSyntax
144
+
145
+ private predicate getRelevantAccessPath ( string path ) {
146
+ summaryModel ( _, _, _, _, _, _, path , _, _, _, _) or
147
+ summaryModel ( _, _, _, _, _, _, _, path , _, _, _) or
148
+ sinkModel ( _, _, _, _, _, _, path , _, _, _) or
149
+ sourceModel ( _, _, _, _, _, _, path , _, _, _)
150
+ }
151
+
152
+ private module MkAccessPath = AccessPathSyntax:: AccessPath< getRelevantAccessPath / 1 > ;
153
+
154
+ class AccessPath = MkAccessPath:: AccessPath ;
155
+
156
+ class AccessPathToken = MkAccessPath:: AccessPathToken ;
157
+
143
158
private string getInvalidModelInput ( ) {
144
- exists ( string pred , AccessPath input , string part |
159
+ exists ( string pred , AccessPath input , AccessPathToken part |
145
160
sinkModel ( _, _, _, _, _, _, input , _, _, _) and pred = "sink"
146
161
or
147
162
summaryModel ( _, _, _, _, _, _, input , _, _, _, _) and pred = "summary"
@@ -159,7 +174,7 @@ module ModelValidation {
159
174
}
160
175
161
176
private string getInvalidModelOutput ( ) {
162
- exists ( string pred , string output , string part |
177
+ exists ( string pred , AccessPath output , AccessPathToken part |
163
178
sourceModel ( _, _, _, _, _, _, output , _, _, _) and pred = "source"
164
179
or
165
180
summaryModel ( _, _, _, _, _, _, _, output , _, _, _) and pred = "summary"
0 commit comments