summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-05-23 16:46:30 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-05-23 16:50:16 +0200
commit26cf118247855bb5caeac3d8e68906fbcfcdc837 (patch)
treee549421446742ebffe649889b7c95fd4ea5273f2 /bridges
parentf2dcc78a379c9bd5aaf93b2ed00649b28be7a6e1 (diff)
Fix undefined misaligned writes
Change-Id: I8ad64babd43c2a692c305f3fa56331edb6d502ee
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx9
1 files changed, 7 insertions, 2 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 2373769745d8..58c4ac156584 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -411,11 +411,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;