Skip to content

Commit 557adaf

Browse files
committed
Update invalid model predicates
1 parent 8e2e327 commit 557adaf

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,14 @@ module ModelValidation {
165165
(
166166
invalidSpecComponent(input, part) and
167167
not part = "" and
168-
not parseArg(part, _)
168+
not (part = "Argument" and pred = "sink") and
169+
not parseArg(part, _) and
170+
not part.getName() = "Field"
169171
or
170-
part = input.getToken(_) and
172+
part = input.getToken(0) and
171173
parseParam(part, _)
174+
or
175+
invalidIndexComponent(input, part)
172176
) and
173177
result = "Unrecognized input specification \"" + part + "\" in " + pred + " model."
174178
)
@@ -180,9 +184,14 @@ module ModelValidation {
180184
or
181185
summaryModel(_, _, _, _, _, _, _, output, _, _, _) and pred = "summary"
182186
|
183-
invalidSpecComponent(output, part) and
184-
not part = "" and
185-
not (part = "Parameter" and pred = "source") and
187+
(
188+
invalidSpecComponent(output, part) and
189+
not part = "" and
190+
not (part = ["Argument", "Parameter"] and pred = "source") and
191+
not part.getName() = "Field"
192+
or
193+
invalidIndexComponent(output, part)
194+
) and
186195
result = "Unrecognized output specification \"" + part + "\" in " + pred + " model."
187196
)
188197
}

0 commit comments

Comments
 (0)