Repository navigation
Fixes to the FreeBSD arm64 bridge - #511
Merged
Merged
Conversation
Fix two issues in the FreeBSD aarch64 C++-UNO bridge: 1. abi.cxx: align_stack_offset and stack_size now use the type's natural alignment (nAlignment) and raw size (nSize) instead of hardcoded 8/alignment and 8-byte slot rounding. This matches the AAPCS64/System V ABI requirement that stack arguments use their natural alignment and size, matching the macOS reference. 2. uno2cpp.cxx: Restructure the return-value switch to use 'default' with a bSimpleReturn check (matching the macOS reference), so fill_struct is only called for register-returned aggregates, not for types that use the x8 hidden-result buffer.
Ensure each stack argument occupies a full 8-byte slot per AAPCS64 requirements. Small types (BYTE, SHORT, LONG, BOOLEAN, etc.) are now sign/zero-extended into a sal_uInt64 scratch slot before being copied to the stack, preventing garbage values from uninitialized upper bytes. This fixes the testPackedStack BridgeTest failure where nStack was 24 instead of the expected 48, and resolves the cascading transportAny crash caused by corrupt stack values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With these changes the testtools/bridgetest passes on FreeBSD/aarch64.