external/firebird/ubsan.patch |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit d5445a8c470a661fac81a3f6fc55f6895a8ed9bc
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Jan 9 15:33:04 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Jan 9 17:26:29 2024 +0100

    external/firebird: Reinstate UBSan function-type-mismatch fix
    
    ...that had erroneously been removed by 
00eae23267bf64e07cf057f828cd85f3c38ac669
    "tdf#134526 Firebird: upgrade to release 3.0.11", causing
    
    > workdir/UnpackedTarball/firebird/src/intl/cs_icu.cpp:66:30: runtime 
error: call to function ucnv_fromUChars_73 through pointer to incorrect 
function type 'int (*)(UConverter *, char *, int, const unsigned short *, int, 
UErrorCode *)'
    > workdir/UnpackedTarball/icu/source/common/ucnv.cpp:1727: note: 
ucnv_fromUChars_73 defined here
    
    etc. to reappear that had originally been fixed with
    8336c1b579b6dff361e5422ebcdd225056752ed4 "New UBSan failures with Firebird
    3.0.7".
    
    Which then leads to the valid build failure
    
    > workdir/UnpackedTarball/firebird/src/common/unicode_util.cpp:1381:25: 
error: no matching constructor for initialization of 'const Array<USHORT>' (aka 
'const Array<unsigned short>')
    >  1381 |                                 const Array<USHORT> str(strChars, 
prefixLen);
    >       |                                                     ^   
~~~~~~~~~~~~~~~~~~~
    
    so include a fix for that.
    
    Change-Id: I30436b62d3adca511aa929317ac9cb7f31576382
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161832
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/external/firebird/ubsan.patch b/external/firebird/ubsan.patch
index 4f55bfc7a54b..7c6af106829b 100644
--- a/external/firebird/ubsan.patch
+++ b/external/firebird/ubsan.patch
@@ -86,6 +86,15 @@
                        return *this;
                }
                StringType& assign(const_pointer s)
+--- src/common/common.h
++++ src/common/common.h
+@@ -1002,6 +1002,5 @@
+ }
+ 
+ #undef UCHAR_TYPE
+-#define UCHAR_TYPE uint16_t
+ 
+ #endif /* COMMON_COMMON_H */
 --- src/common/unicode_util.cpp
 +++ src/common/unicode_util.cpp
 @@ -187,7 +187,7 @@
@@ -97,6 +106,15 @@
  
        int32_t (U_EXPORT2 *ulocCountAvailable)();
        const char* (U_EXPORT2 *ulocGetAvailable)(int32_t n);
+@@ -1378,7 +1378,7 @@
+ 
+                       for (int prefixLen = 1; prefixLen < len; ++prefixLen)
+                       {
+-                              const Array<USHORT> str(strChars, prefixLen);
++                              const Array<USHORT> str(reinterpret_cast<USHORT 
*>(strChars), prefixLen);
+                               SortKeyArray* keySet = 
obj->contractionsPrefix.get(str);
+ 
+                               if (!keySet)
 --- src/dsql/StmtNodes.cpp
 +++ src/dsql/StmtNodes.cpp
 @@ -6643,7 +6643,7 @@

Reply via email to