From ad9104d2b45bb8f51d12135fa82c72fdbd21236a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 3 Feb 2025 17:29:23 +0100 Subject: [PATCH] Add an error check for struct members with their array size at the wrong position. (#2059) --- VulkanHppGenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index a27f821..1454e8f 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -15686,6 +15686,9 @@ void VulkanHppGenerator::readStructMember( tinyxml2::XMLElement const * element, } assert( !name.empty() ); + checkForError( ( memberData.type.postfix.length() < 3 ) || !memberData.type.postfix.starts_with( "[" ) || !memberData.type.postfix.ends_with( "]" ), + line, + "struct member <" + name + "> has its array size <" + memberData.type.postfix + "> at the wrong position" ); if ( api.empty() || ( api == m_api ) ) { checkForError( std::none_of( members.begin(), members.end(), [&name]( MemberData const & md ) { return md.name == name; } ),