Fix edge case in MaD validation

If the db contains no pointer types then we were getting spurious model
validation errors.
This commit is contained in:
Owen Mansel-Chan
2026-01-22 22:12:30 +00:00
parent e1bddd9365
commit 936c4cc79f

View File

@@ -153,7 +153,10 @@ module ModelValidation {
not part = "" and
not (part = "Argument" and pred = "sink") and
not parseArg(part, _) and
not part.getName() = "Field"
// If the database does not contain any fields/pointer types then no
// FieldContent/PointerContent exists, so we spuriously think that
// these spec components are invalid.
not part.getName() = ["Field", "Dereference"]
or
part = input.getToken(0) and
parseParam(part, _)
@@ -176,7 +179,10 @@ module ModelValidation {
invalidSpecComponent(output, part) and
not part = "" and
not (part = ["Argument", "Parameter"] and pred = "source") and
not part.getName() = "Field"
// If the database does not contain any fields/pointer types then no
// FieldContent/PointerContent exists, so we spuriously think that
// these spec components are invalid.
not part.getName() = ["Field", "Dereference"]
or
invalidIndexComponent(output, part)
) and