Bug 1795102, part 3 - Check that size_is parameter input-ness matches. r=nika

If I remembered anything from my logic programming days, I could
come up a smarter sounding word for this than "input-ness".

Differential Revision: https://phabricator.services.mozilla.com/D159318
This commit is contained in:
Andrew McCreight 2022-10-13 23:41:14 +00:00
Родитель 27bac104c6
Коммит 5b6d7aabe4
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -1342,6 +1342,14 @@ class Method(object):
)
if p.size_is:
size_param = self.namemap.get(p.size_is, p.location)
if (
p.paramtype.count("in") == 1
and size_param.paramtype.count("in") == 0
):
raise IDLError(
"size_is parameter of an input must also be an input",
p.location,
)
if getBuiltinOrNativeTypeName(size_param.realtype) != "unsigned long":
raise IDLError(
"size_is parameter must have type 'unsigned long'",