Change assertion to condition on generating the vector size check. (#1518)

This commit is contained in:
Andreas Süßenbach 2023-02-23 10:07:26 +01:00 committed by GitHub
parent 2207dc92c6
commit bceab2b9d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8098,10 +8098,8 @@ std::string VulkanHppGenerator::generateRAIIHandleVectorSizeCheck( std::string c
size_t defaultStartIndex = determineDefaultStartIndex( commandData.params, skippedParams );
std::string firstVectorName = startLowerCase( stripPrefix( commandData.params[cvm.second[0]].name, "p" ) );
if ( cvm.second.size() == 1 )
if ( ( cvm.second.size() == 1 ) && ( isLenByStructMember( commandData.params[cvm.second[0]].len, commandData.params[cvm.first] ) ) )
{
assert( isLenByStructMember( commandData.params[cvm.second[0]].len, commandData.params[cvm.first] ) );
std::vector<std::string> lenParts = tokenize( commandData.params[cvm.second[0]].len, "->" );
assert( lenParts.size() == 2 );
std::string sizeValue = startLowerCase( stripPrefix( lenParts[0], "p" ) ) + "." + lenParts[1];
@ -9972,10 +9970,8 @@ std::string VulkanHppGenerator::generateVectorSizeCheck( std::string const &
size_t defaultStartIndex = determineDefaultStartIndex( commandData.params, skippedParams );
std::string firstVectorName = startLowerCase( stripPrefix( commandData.params[cvm.second[0]].name, "p" ) );
if ( cvm.second.size() == 1 )
if ( ( cvm.second.size() == 1 ) && ( isLenByStructMember( commandData.params[cvm.second[0]].len, commandData.params[cvm.first] ) ) )
{
assert( isLenByStructMember( commandData.params[cvm.second[0]].len, commandData.params[cvm.first] ) );
std::vector<std::string> lenParts = tokenize( commandData.params[cvm.second[0]].len, "->" );
assert( lenParts.size() == 2 );
std::string sizeValue = startLowerCase( stripPrefix( lenParts[0], "p" ) ) + "." + lenParts[1];