Home | History | Annotate | Download | only in patches
      1 Index: common/unicode/unistr.h
      2 ===================================================================
      3 --- common/unicode/unistr.h	(revision 75773)
      4 +++ common/unicode/unistr.h	(working copy)
      5 @@ -4089,7 +4089,7 @@
      6  #if defined(__GNUC__)
      7    // Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address
      8    // This is only an issue when using GCC and certain optimizations are turned on.
      9 -  return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage);
     10 +  return extract(start, _length, dst, dst!=0 ? ((dst >= (char*)((size_t)-1) - UINT32_MAX) ? static_cast<unsigned int>((((char*)UINT32_MAX) - dst)) : UINT32_MAX) : 0, codepage);
     11  #else
     12    return extract(start, _length, dst, dst!=0 ? 0xffffffff : 0, codepage);
     13  #endif
     14 Index: source/i18n/colldata.cpp
     15 ===================================================================
     16 --- source/i18n/colldata.cpp	(revision 122103)
     17 +++ source/i18n/colldata.cpp	(working copy)
     18 @@ -236,9 +236,14 @@
     19          int32_t newMax = listMax + STRING_LIST_BUFFER_SIZE;
     20  
     21          UnicodeString *newStrings = new UnicodeString[newMax];
     22 +        if (newStrings == NULL) {
     23 +            status = U_MEMORY_ALLOCATION_ERROR;
     24 +            return;
     25 +        }
     26 +        for (int32_t i=0; i<listSize; ++i) {
     27 +            newStrings[i] = strings[i];
     28 +        }
     29  
     30 -        uprv_memcpy(newStrings, strings, listSize * sizeof(UnicodeString));
     31 -
     32  #ifdef INSTRUMENT_STRING_LIST
     33          int32_t _h = listSize / STRING_LIST_BUFFER_SIZE;
     34  
     35 Index: source/i18n/decNumber.c
     36 ===================================================================
     37 --- source/i18n/decNumber.c	(revision 122360)
     38 +++ source/i18n/decNumber.c	(working copy)
     39 @@ -1392,6 +1392,8 @@
     40  /* fastpath in decLnOp.  The final division is done to the requested  */
     41  /* precision.                                                         */
     42  /* ------------------------------------------------------------------ */
     43 +#pragma clang diagnostic push
     44 +#pragma clang diagnostic ignored "-Warray-bounds"
     45  U_CAPI decNumber * U_EXPORT2 uprv_decNumberLog10(decNumber *res, const decNumber *rhs,
     46                            decContext *set) {
     47    uInt status=0, ignore=0;         /* status accumulators  */
     48 @@ -1527,6 +1529,7 @@
     49    #endif
     50    return res;
     51    } /* decNumberLog10  */
     52 +#pragma clang diagnostic pop
     53  
     54  /* ------------------------------------------------------------------ */
     55  /* decNumberMax -- compare two Numbers and return the maximum         */
     56 @@ -2800,6 +2803,8 @@
     57  /* result setexp(approx, e div 2)  % fix exponent                     */
     58  /* end sqrt                                                           */
     59  /* ------------------------------------------------------------------ */
     60 +#pragma clang diagnostic push
     61 +#pragma clang diagnostic ignored "-Warray-bounds"
     62  U_CAPI decNumber * U_EXPORT2 uprv_decNumberSquareRoot(decNumber *res, const decNumber *rhs,
     63                                  decContext *set) {
     64    decContext workset, approxset;   /* work contexts  */
     65 @@ -3129,6 +3134,7 @@
     66    #endif
     67    return res;
     68    } /* decNumberSquareRoot  */
     69 +#pragma clang diagnostic pop
     70  
     71  /* ------------------------------------------------------------------ */
     72  /* decNumberSubtract -- subtract two Numbers                          */
     73 @@ -5584,6 +5590,8 @@
     74  /* 5. The static buffers are larger than might be expected to allow   */
     75  /*    for calls from decNumberPower.                                  */
     76  /* ------------------------------------------------------------------ */
     77 +#pragma clang diagnostic push
     78 +#pragma clang diagnostic ignored "-Warray-bounds"
     79  decNumber * decLnOp(decNumber *res, const decNumber *rhs,
     80                      decContext *set, uInt *status) {
     81    uInt ignore=0;                   /* working status accumulator  */
     82 @@ -5805,6 +5813,7 @@
     83    /* [status is handled by caller]  */
     84    return res;
     85    } /* decLnOp  */
     86 +#pragma clang diagnostic pop
     87  
     88  /* ------------------------------------------------------------------ */
     89  /* decQuantizeOp  -- force exponent to requested value                */
     90