glapi: guard against invalid XML definitions for glthread
authorMarek Olšák <marek.olsak@amd.com>
Thu, 28 Jan 2021 04:12:54 +0000 (23:12 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 29 Jan 2021 02:28:42 +0000 (02:28 +0000)
This would have prevented the bug that the previous commit fixes.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8753>

src/mapi/glapi/gen/gl_XML.py

index 94e742f..da80ea1 100644 (file)
@@ -653,6 +653,12 @@ class gl_function( gl_item ):
         name = element.get( "name" )
         alias = element.get( "alias" )
 
+        # marshal isn't allowed with alias
+        assert not alias or not element.get('marshal')
+        assert not alias or not element.get('marshal_count')
+        assert not alias or not element.get('marshal_sync')
+        assert not alias or not element.get('marshal_call_after')
+
         if name in static_data.functions:
             self.static_entry_points.append(name)