[Libreoffice-commits] core.git: 4 commits - bridges/source external/python3 include/vcl

Stephan Bergmann sbergman at redhat.com
Fri Dec 16 06:48:51 UTC 2016


 bridges/source/cpp_uno/gcc3_macosx_x86-64/cpp2uno.cxx |    9 ++
 external/python3/ubsan.patch.0                        |   60 +++++++++++-------
 include/vcl/menu.hxx                                  |    2 
 3 files changed, 47 insertions(+), 24 deletions(-)

New commits:
commit 3024e891b2ce85059069e599e411db457e4bccd1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Nov 12 10:16:38 2016 +0100

    Fix undefined misaligned writes
    
    same as 26cf118247855bb5caeac3d8e68906fbcfcdc837 for gcc_linux_x86-64
    
    Change-Id: Ieb7a4c0497ea485e832da937786226f09feeff31

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 dccb9da..e16b2f1 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;
commit 291c0b8fafd4c2cb1086bb321526f951768692a5
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Sat Nov 12 09:56:21 2016 +0100

    Typo "pStaredFrom" -> "pStartedFrom"?
    
    But function definition uses "pSFrom" instead anyway, so consistently use param
    names from definition in declaration.
    
    Change-Id: I03fb8dd0fbab5c84f89c7276849d62f9a17cbfea

diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 4a119a0..f2202d1 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -495,7 +495,7 @@ private:
     SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
 
 protected:
-    SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& xWindow, const Rectangle& rRect, FloatWinPopupFlags nPopupFlags, Menu* pStaredFrom, bool bPreSelectFirst );
+    SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& pW, const Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst );
     SAL_DLLPRIVATE void ImplFlushPendingSelect();
     SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
     SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
commit 9b92834fa4ee27b0dccdd52962edb3fdbee7a340
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 11 23:35:15 2016 +0100

    external/python3: Work around -fsanitize=alignment
    
    Change-Id: I26b927345594368f426ae89bfd5b645561d44c10

diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 639e85f..ab2acd3 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -35,6 +35,26 @@
  
    /* Set the carry bit iff the function uses any sse registers.
       This is clc or stc, together with the first byte of the jmp.  */
+--- Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
++++ Modules/_ctypes/libffi_osx/x86/x86-ffi64.c
+@@ -599,9 +599,15 @@
+ 	tramp = (volatile unsigned short*)&closure->tramp[0];
+ 
+ 	tramp[0] = 0xbb49;		/* mov <code>, %r11	*/
+-	*(void* volatile*)&tramp[1] = ffi_closure_unix64;
++	tramp[1] = (unsigned short) ffi_closure_unix64;
++	tramp[2] = (unsigned short) (ffi_closure_unix64 >> 16);
++	tramp[3] = (unsigned short) (ffi_closure_unix64 >> 32);
++	tramp[4] = (unsigned short) (ffi_closure_unix64 >> 48);
+ 	tramp[5] = 0xba49;		/* mov <data>, %r10	*/
+-	*(void* volatile*)&tramp[6] = closure;
++	tramp[6] = (unsigned short) closure;
++	tramp[7] = (unsigned short) (closure >> 16);
++	tramp[8] = (unsigned short) (closure >> 32);
++	tramp[9] = (unsigned short) (closure >> 48);
+ 
+ 	/*	Set the carry bit if the function uses any sse registers.
+ 		This is clc or stc, together with the first byte of the jmp.  */
 --- Objects/listobject.c
 +++ Objects/listobject.c
 @@ -641,7 +641,7 @@
commit 6928b045f09b5d983083607d63fcb2a547446d0a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 11 23:34:39 2016 +0100

    Clean up patch
    
    Change-Id: I2aa51435d0a15e507d0bf95f98d69fa4cde00b05

diff --git a/external/python3/ubsan.patch.0 b/external/python3/ubsan.patch.0
index 700f43b..639e85f 100644
--- a/external/python3/ubsan.patch.0
+++ b/external/python3/ubsan.patch.0
@@ -1,6 +1,20 @@
-diff -ru python3.orig/Modules/_ctypes/libffi/src/x86/ffi64.c python3/Modules/_ctypes/libffi/src/x86/ffi64.c
---- Modules/_ctypes/libffi/src/x86/ffi64.c	2015-07-05 18:50:07.000000000 +0200
-+++ Modules/_ctypes/libffi/src/x86/ffi64.c	2015-07-26 20:18:56.457153323 +0200
+--- Modules/_ctypes/_ctypes.c
++++ Modules/_ctypes/_ctypes.c
+@@ -1358,8 +1358,10 @@
+         goto error;
+     }
+     stgdict->shape[0] = length;
+-    memmove(&stgdict->shape[1], itemdict->shape,
+-        sizeof(Py_ssize_t) * (stgdict->ndim - 1));
++    if (itemdict->shape) {
++        memmove(&stgdict->shape[1], itemdict->shape,
++            sizeof(Py_ssize_t) * (stgdict->ndim - 1));
++    }
+ 
+     itemsize = itemdict->size;
+     if (length * itemsize < 0) {
+--- Modules/_ctypes/libffi/src/x86/ffi64.c
++++ Modules/_ctypes/libffi/src/x86/ffi64.c
 @@ -548,11 +548,15 @@
    tramp = (volatile unsigned short *) &closure->tramp[0];
  
@@ -21,9 +35,8 @@ diff -ru python3.orig/Modules/_ctypes/libffi/src/x86/ffi64.c python3/Modules/_ct
  
    /* Set the carry bit iff the function uses any sse registers.
       This is clc or stc, together with the first byte of the jmp.  */
-diff -ru python3.orig/Objects/listobject.c python3/Objects/listobject.c
---- Objects/listobject.c	2015-07-05 18:50:08.000000000 +0200
-+++ Objects/listobject.c	2015-07-26 20:22:30.539167695 +0200
+--- Objects/listobject.c
++++ Objects/listobject.c
 @@ -641,7 +641,7 @@
              goto Error;
          }
@@ -33,18 +46,3 @@ diff -ru python3.orig/Objects/listobject.c python3/Objects/listobject.c
  
      if (d < 0) { /* Delete -d items */
          Py_ssize_t tail;
---- Modules/_ctypes/_ctypes.c
-+++ Modules/_ctypes/_ctypes.c
-@@ -1358,8 +1358,10 @@
-         goto error;
-     }
-     stgdict->shape[0] = length;
--    memmove(&stgdict->shape[1], itemdict->shape,
--        sizeof(Py_ssize_t) * (stgdict->ndim - 1));
-+    if (itemdict->shape) {
-+        memmove(&stgdict->shape[1], itemdict->shape,
-+            sizeof(Py_ssize_t) * (stgdict->ndim - 1));
-+    }
- 
-     itemsize = itemdict->size;
-     if (length * itemsize < 0) {


More information about the Libreoffice-commits mailing list