This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO41X by this push:
new 412f88f655 Fix the macOS x86 bridge. Previous version was fragile.
412f88f655 is described below
commit 412f88f655568c92cc0aaf1226b59d5b1d539fda
Author: Jim Jagielski <[email protected]>
AuthorDate: Fri Jun 5 10:38:17 2026 -0400
Fix the macOS x86 bridge. Previous version was fragile.
---
main/bridges/source/cpp_uno/s5abi_macosx_x86-64/cpp2uno.cxx | 10 ++++++++--
main/bridges/source/cpp_uno/s5abi_macosx_x86-64/uno2cpp.cxx | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/cpp2uno.cxx
b/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/cpp2uno.cxx
index d7fd5b2a25..533adb9740 100644
--- a/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/cpp2uno.cxx
+++ b/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/cpp2uno.cxx
@@ -265,7 +265,8 @@ extern "C" typelib_TypeClass cpp_vtable_call(
// fpreg: [fpr params]
// ovrflw: [gpr or fpr params (properly aligned)]
void * pThis;
- if ( nFunctionIndex & 0x80000000 )
+ bool bHasHiddenReturn = (nFunctionIndex & 0x80000000) != 0;
+ if ( bHasHiddenReturn )
{
nFunctionIndex &= 0x7fffffff;
pThis = gpreg[1];
@@ -338,6 +339,11 @@ extern "C" typelib_TypeClass cpp_vtable_call(
eRet = typelib_TypeClass_VOID;
break;
case 0: // queryInterface() opt
+ // Only apply when hidden return is present:
+ // gpreg[0]=ret, gpreg[1]=this, gpreg[2]=type
+ // Without hidden return gpreg[2] is not the
type arg.
+ if ( !bHasHiddenReturn )
+ break;
{
typelib_TypeDescription * pTD = 0;
TYPELIB_DANGER_GET( &pTD,
reinterpret_cast<Type *>( gpreg[2] )->getTypeLibType() );
@@ -434,7 +440,7 @@ extern "C" void privateSnippetExecutor( void )
" movq -136(%rbp), %xmm1\n" // Return value (int
case)
" jmp .Lfinish\n"
".Lfloat:\n"
- " movlpd -144(%rbp), %xmm0\n" // Return value
(float/double case)
+ " movsd -144(%rbp), %xmm0\n" // Return value
(float/double case)
".Lfinish:\n"
" addq $160, %rsp\n"
);
diff --git a/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/uno2cpp.cxx
b/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/uno2cpp.cxx
index c9f5e5de24..1314f3bc91 100644
--- a/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/uno2cpp.cxx
+++ b/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/uno2cpp.cxx
@@ -151,7 +151,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32
nVtableIndex,
"m" ( rax ), "m" ( rdx ), "m" ( xmm0 ), "m" ( xmm1 ),
"m" (pCallStack) // dummy input to prevent the compiler from
optimizing the alloca out
: "rax", "rbx", "rcx", "rdx", "rdi", "rsi", "r8", "r9",
- "r10", "r11", "r10", "r12", "r13", "r14", "r15", "rbx",
+ "r10", "r11", "r12", "r13", "r14", "r15",
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"
);