Skip to content

Commit

Permalink
Refs #22484: Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Dec 16, 2024
1 parent 0feca2c commit 54e211b
Showing 1 changed file with 37 additions and 5 deletions.
42 changes: 37 additions & 5 deletions src/cpp/xmlparser/XMLDynamicParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,14 +1309,46 @@ DynamicType::_ref_type XMLParser:: parseXMLMemberDynamicType(

if (!isArray)
{
member = factory->create_sequence_type(content_type, length)->build();
DynamicTypeBuilder::_ref_type inner_builder{factory->create_sequence_type(content_type, length)};
if (nullptr != inner_builder)
{
member = inner_builder->build();
}
else
{
EPROSIMA_LOG_ERROR(XMLPARSER,
"Error parsing sequence element type: Cannot recognize inner content of member: " <<
memberType);
return {};
}
}
else
{
DynamicTypeBuilder::_ref_type inner_builder {factory->create_sequence_type(content_type, length)};
std::vector<uint32_t> bounds;
dimensionsToArrayBounds(memberArray, bounds);
member = factory->create_array_type(inner_builder->build(), bounds)->build();
DynamicTypeBuilder::_ref_type inner_builder{factory->create_sequence_type(content_type, length)};
if (nullptr != inner_builder)
{
std::vector<uint32_t> bounds;
dimensionsToArrayBounds(memberArray, bounds);
DynamicTypeBuilder::_ref_type sub_builder{factory->create_array_type(inner_builder->build(), bounds)};
if (nullptr != sub_builder)
{
member = sub_builder->build();
}
else
{
EPROSIMA_LOG_ERROR(XMLPARSER,
"Error parsing sequence element type: Cannot recognize inner content of member: " <<
memberType);
return {};
}
}
else
{
EPROSIMA_LOG_ERROR(XMLPARSER,
"Error parsing sequence element type: Cannot recognize inner content of member: " <<
memberType);
return {};
}
}
}
else if (p_root->Attribute(MAP_MAXLENGTH) != nullptr)
Expand Down

0 comments on commit 54e211b

Please sign in to comment.