mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-04-03 14:00:48 +02:00
scanner: ensure 'since' doesn't exceed the interface version
See https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/327 Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/328>
This commit is contained in:
parent
b0deafc641
commit
962863cbc4
1 changed files with 16 additions and 0 deletions
|
|
@ -565,6 +565,11 @@ class ProtocolParser(xml.sax.handler.ContentHandler):
|
|||
f"Missing attribute {e} in element '{element}'",
|
||||
self.location,
|
||||
)
|
||||
if since > self.current_interface.version:
|
||||
raise XmlError.create(
|
||||
f"Invalid 'since' {since} for '{self.current_interface.name}.{name}'",
|
||||
self.location,
|
||||
)
|
||||
|
||||
try:
|
||||
is_bitfield = {
|
||||
|
|
@ -618,6 +623,12 @@ class ProtocolParser(xml.sax.handler.ContentHandler):
|
|||
f"Missing attribute {e} in element '{element}'",
|
||||
self.location,
|
||||
)
|
||||
if since > self.current_interface.version:
|
||||
raise XmlError.create(
|
||||
f"Invalid 'since' {since} for '{self.current_interface.name}.{name}'",
|
||||
self.location,
|
||||
)
|
||||
|
||||
is_destructor = attrs.get("type", "") == "destructor"
|
||||
opcode = len(self.current_interface.requests)
|
||||
request = Request.create(
|
||||
|
|
@ -652,6 +663,11 @@ class ProtocolParser(xml.sax.handler.ContentHandler):
|
|||
f"Missing attribute {e} in element '{element}'",
|
||||
self.location,
|
||||
)
|
||||
if since > self.current_interface.version:
|
||||
raise XmlError.create(
|
||||
f"Invalid 'since' {since} for '{self.current_interface.name}.{name}'",
|
||||
self.location,
|
||||
)
|
||||
|
||||
is_destructor = attrs.get("type", "") == "destructor"
|
||||
opcode = len(self.current_interface.events)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue