Skip to content

[23684] Fix mutable size-three optional serialization (backport #253)#277

Merged
MiguelCompany merged 1 commit into2.2.xfrom
mergify/bp/2.2.x/pr-253
Sep 11, 2025
Merged

[23684] Fix mutable size-three optional serialization (backport #253)#277
MiguelCompany merged 1 commit into2.2.xfrom
mergify/bp/2.2.x/pr-253

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Sep 11, 2025

Description

This PR fixes mutable calculate_serialized_size of a size-three optional type. XCDR2 EMHEADER size wrongly computed (4 bytes) for mutable optional field with size different from 1, 2, 4 or 8. It should have a 8 bytes EMHEADER.

@final
struct FinalSizeThree
{
    octet a;
    octet b;
    octet c;
};

@mutable
struct RegressionType
{
    @optional FinalSizeThree opt_fin_size_three;
};

@Mergifyio backport 2.2.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • N/A Any new/modified methods have been properly documented using Doxygen.
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • N/A New feature has been added to the versions.md file (if applicable).
  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: CI pass and failing tests are unrelated with the changes.

This is an automatic backport of pull request #253 done by [Mergify](https://mergify.com).

* Refs #23684: Add regression test

Signed-off-by: Jesus Perez <[email protected]>

* Refs #23684: Fix mutable size-three optional serialization

Signed-off-by: Jesus Perez <[email protected]>

* Refs #23684: Uncrustify

Signed-off-by: Jesus Perez <[email protected]>

---------

Signed-off-by: Jesus Perez <[email protected]>
(cherry picked from commit f00d560)
@MiguelCompany MiguelCompany added this to the v2.2.7 milestone Sep 11, 2025
@MiguelCompany MiguelCompany self-requested a review September 11, 2025 08:43
@MiguelCompany MiguelCompany merged commit dac7da9 into 2.2.x Sep 11, 2025
12 checks passed
@MiguelCompany MiguelCompany deleted the mergify/bp/2.2.x/pr-253 branch September 11, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants