12
12
* - Summaries:
13
13
* `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
14
14
* - Neutrals:
15
- * `package; type; name; signature; provenance`
15
+ * `package; type; name; signature; kind; provenance`
16
16
* A neutral is used to indicate that there is no flow via a callable.
17
17
*
18
18
* The interpretation of a row is similar to API-graphs with a left-to-right
65
65
* which classes the interpreted elements should be added. For example, for
66
66
* sources "remote" indicates a default remote flow source, and for summaries
67
67
* "taint" indicates a default additional taint step and "value" indicates a
68
- * globally applicable value-preserving step.
68
+ * globally applicable value-preserving step. For neutrals the kind can be `summary`,
69
+ * `source` or `sink` to indicate that the neutral is neutral with respect to
70
+ * flow (no summary), source (is not a source) or sink (is not a sink).
69
71
* 9. The `provenance` column is a tag to indicate the origin and verification of a model.
70
72
* The format is {origin}-{verification} or just "manual" where the origin describes
71
73
* the origin of the model and verification describes how the model has been verified.
@@ -165,7 +167,7 @@ predicate summaryModel(
165
167
}
166
168
167
169
/** Holds if a neutral model exists indicating there is no flow for the given parameters. */
168
- predicate neutralModel = Extensions:: neutralModel / 5 ;
170
+ predicate neutralModel = Extensions:: neutralModel / 6 ;
169
171
170
172
private predicate relevantPackage ( string package ) {
171
173
sourceModel ( package , _, _, _, _, _, _, _, _) or
@@ -288,6 +290,11 @@ module ModelValidation {
288
290
not kind .matches ( "qltest%" ) and
289
291
result = "Invalid kind \"" + kind + "\" in source model."
290
292
)
293
+ or
294
+ exists ( string kind | neutralModel ( _, _, _, _, kind , _) |
295
+ not kind = [ "summary" , "source" , "sink" ] and
296
+ result = "Invalid kind \"" + kind + "\" in neutral model."
297
+ )
291
298
}
292
299
293
300
private string getInvalidModelSignature ( ) {
@@ -302,7 +309,7 @@ module ModelValidation {
302
309
summaryModel ( package , type , _, name , signature , ext , _, _, _, provenance ) and
303
310
pred = "summary"
304
311
or
305
- neutralModel ( package , type , name , signature , provenance ) and
312
+ neutralModel ( package , type , name , signature , _ , provenance ) and
306
313
ext = "" and
307
314
pred = "neutral"
308
315
|
@@ -346,7 +353,7 @@ private predicate elementSpec(
346
353
or
347
354
summaryModel ( package , type , subtypes , name , signature , ext , _, _, _, _)
348
355
or
349
- neutralModel ( package , type , name , signature , _) and ext = "" and subtypes = false
356
+ neutralModel ( package , type , name , signature , _, _ ) and ext = "" and subtypes = false
350
357
}
351
358
352
359
/**
0 commit comments