Skip to content

Avoid clearing com_array object representation - #1642

Open
Daniel Jump (DanielJump) wants to merge 2 commits into
microsoft:masterfrom
DanielJump:fix-com-array-detach
Open

Daniel Jump (DanielJump) wants to merge 2 commits into
microsoft:masterfrom
DanielJump:fix-com-array-detach

Conversation

@DanielJump

@DanielJump Daniel Jump (DanielJump) commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • replace memset of the non-trivially-copyable com_array object with explicit data and size resets
  • share the ownership-release logic across the MSVC and non-MSVC result-construction paths
  • add a focused test covering detach ownership, source reset, and retained array contents

The existing MSVC std::pair padding workaround remains unchanged.

Validation

  • x64 Debug solution build
  • test_old.exe '*detach*': 18 assertions in 5 test cases passed
  • patch formatting and line endings checked

Reset the detached array's data and size members explicitly so detach_abi does not write through the representation of a non-trivially-copyable object.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c
Hostname: DanJump0
Reset the com_array members after the compiler-specific result construction so both paths use the same ownership-release logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8b45cfea-cc0f-4a1f-8b2a-86c89d063c6c
Hostname: DanJump0
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.

1 participant