diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-12 10:16:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-16 07:46:41 +0100 |
commit | 3024e891b2ce85059069e599e411db457e4bccd1 (patch) | |
tree | 06cef23757c529248729bc4fe529d83ad712074b /bridges | |
parent | 291c0b8fafd4c2cb1086bb321526f951768692a5 (diff) |
Fix undefined misaligned writes
same as 26cf118247855bb5caeac3d8e68906fbcfcdc837 for gcc_linux_x86-64
Change-Id: Ieb7a4c0497ea485e832da937786226f09feeff31
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx index dccb9da696f5..e16b2f12b437 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx @@ -414,11 +414,16 @@ unsigned char * codeSnippet( unsigned char * code, // movq $<nOffsetAndIndex>, %r10 *reinterpret_cast<sal_uInt16 *>( code ) = 0xba49; - *reinterpret_cast<sal_uInt64 *>( code + 2 ) = nOffsetAndIndex; + *reinterpret_cast<sal_uInt16 *>( code + 2 ) = nOffsetAndIndex & 0xFFFF; + *reinterpret_cast<sal_uInt32 *>( code + 4 ) = nOffsetAndIndex >> 16; + *reinterpret_cast<sal_uInt16 *>( code + 8 ) = nOffsetAndIndex >> 48; // movq $<address of the privateSnippetExecutor>, %r11 *reinterpret_cast<sal_uInt16 *>( code + 10 ) = 0xbb49; - *reinterpret_cast<sal_uInt64 *>( code + 12 ) = reinterpret_cast<sal_uInt64>( privateSnippetExecutor ); + *reinterpret_cast<sal_uInt32 *>( code + 12 ) + = reinterpret_cast<sal_uInt64>(privateSnippetExecutor); + *reinterpret_cast<sal_uInt32 *>( code + 16 ) + = reinterpret_cast<sal_uInt64>(privateSnippetExecutor) >> 32; // jmpq *%r11 *reinterpret_cast<sal_uInt32 *>( code + 20 ) = 0x00e3ff49; |