Skip to content

Fix CmdArgBuffer SERIALIZED_SIZE computation#4978

Open
Sarah5567 wants to merge 3 commits intonasa:develfrom
Sarah5567:fix-buffer-serialized-size
Open

Fix CmdArgBuffer SERIALIZED_SIZE computation#4978
Sarah5567 wants to merge 3 commits intonasa:develfrom
Sarah5567:fix-buffer-serialized-size

Conversation

@Sarah5567
Copy link
Copy Markdown
Contributor

@Sarah5567 Sarah5567 commented Apr 9, 2026

Related Issue(s) #4896
Has Unit Tests (y/n) n
Documentation Included (y/n) n
Generative AI was used in this contribution (y/n) y

Change Description

Fix CmdArgBuffer::SERIALIZED_SIZE, which incorrectly used sizeof(I32) instead of sizeof(FwSizeStoreType).
To prevent this kind of mistake, this PR adds a STATIC_SERIALIZED_SIZE constexpr helper to LinearBufferBase and updates all buffer-derived classes to use it.

Rationale

If FwSizeStoreType is configured larger than I32 (e.g. U64), CmdArgBuffer::SERIALIZED_SIZE would be too small, potentially causing serialization issues.

Testing/Review Recommendations

N/A

Future Work

N/A

AI Usage (see policy)

GitHub Copilot CLI (Claude)

STATIC_SERIALIZED_SIZE to LinearBufferBase
@LeStarch
Copy link
Copy Markdown
Collaborator

LeStarch commented Apr 9, 2026

To fix the formatting, you can run this command:

git diff --name-only devel...HEAD | fprime-util format --stdin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants