diff --git a/proto/ei-scanner b/proto/ei-scanner index af30558..5469934 100755 --- a/proto/ei-scanner +++ b/proto/ei-scanner @@ -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)