Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 936c4cc

Browse files
committed
Fix edge case in MaD validation
If the db contains no pointer types then we were getting spurious model validation errors.
1 parent e1bddd9 commit 936c4cc

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ module ModelValidation {
153153
not part = "" and
154154
not (part = "Argument" and pred = "sink") and
155155
not parseArg(part, _) and
156-
not part.getName() = "Field"
156+
// If the database does not contain any fields/pointer types then no
157+
// FieldContent/PointerContent exists, so we spuriously think that
158+
// these spec components are invalid.
159+
not part.getName() = ["Field", "Dereference"]
157160
or
158161
part = input.getToken(0) and
159162
parseParam(part, _)
@@ -176,7 +179,10 @@ module ModelValidation {
176179
invalidSpecComponent(output, part) and
177180
not part = "" and
178181
not (part = ["Argument", "Parameter"] and pred = "source") and
179-
not part.getName() = "Field"
182+
// If the database does not contain any fields/pointer types then no
183+
// FieldContent/PointerContent exists, so we spuriously think that
184+
// these spec components are invalid.
185+
not part.getName() = ["Field", "Dereference"]
180186
or
181187
invalidIndexComponent(output, part)
182188
) and

0 commit comments

Comments
 (0)