diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-07-27 16:16:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-07-27 22:57:51 +0200 |
commit | 5411aafbfd8656f043bcf30588bc41b061f1b60b (patch) | |
tree | 11d62c81494c41ea4220d534fb80b44d6ccd2e99 /bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx | |
parent | 1940ffc5347768fdc4d2bba636b40d451a274f1e (diff) |
Clean up bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
...without any intended functional changes, in preparation for actual fixes for
tdf#143450 "Data corruption when returning small structs containing a double
from C++ via IPC".
Much of the code (apparently originally copied from some other project,
according to the comments) was too generic for our specific needs here.
Change-Id: Iddcb58fa0999d10dcf716dd2af7dab1620839bce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119570
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 29212988f78d..28f4d4ed9d8d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -107,11 +107,12 @@ static typelib_TypeClass cpp2uno_call( { const typelib_MethodParameter & rParam = pParams[nPos]; - int nUsedGPR = 0; - int nUsedSSE = 0; - bool bFitsRegisters = x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE ); if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( rParam.pTypeRef ) ) // value { + int nUsedGPR = 0; + int nUsedSSE = 0; + bool bFitsRegisters = x86_64::examine_argument( rParam.pTypeRef, nUsedGPR, nUsedSSE ); + // Simple types must fit exactly one register on x86_64 assert( bFitsRegisters && ( ( nUsedSSE == 1 && nUsedGPR == 0 ) || ( nUsedSSE == 0 && nUsedGPR == 1 ) ) ); (void)bFitsRegisters; @@ -136,7 +137,7 @@ static typelib_TypeClass cpp2uno_call( pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw++; } } - else // struct <= 16 bytes || ptr to complex value || ref + else // ref { typelib_TypeDescription * pParamTypeDescr = nullptr; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); |