1diff -ur icu.org/source/common/rbbidata.h icu/source/common/rbbidata.h 2--- icu.org/source/common/rbbidata.h 2017-02-03 19:57:23.000000000 +0100 3+++ icu/source/common/rbbidata.h 2017-04-21 22:46:25.371651160 +0200 4@@ -115,7 +115,7 @@ 5 /* StatusTable of the set of matching */ 6 /* tags (rule status values) */ 7 int16_t fReserved; 8- uint16_t fNextState[2]; /* Next State, indexed by char category. */ 9+ uint16_t fNextState[1]; /* Next State, indexed by char category. */ 10 /* This array does not have two elements */ 11 /* Array Size is actually fData->fHeader->fCatCount */ 12 /* CAUTION: see RBBITableBuilder::getTableSize() */ 13@@ -128,7 +128,7 @@ 14 uint32_t fRowLen; /* Length of a state table row, in bytes. */ 15 uint32_t fFlags; /* Option Flags for this state table */ 16 uint32_t fReserved; /* reserved */ 17- char fTableData[4]; /* First RBBIStateTableRow begins here. */ 18+ char fTableData[1]; /* First RBBIStateTableRow begins here. */ 19 /* (making it char[] simplifies ugly address */ 20 /* arithmetic for indexing variable length rows.) */ 21 }; 22diff -ur icu.org/source/common/rbbitblb.cpp icu/source/common/rbbitblb.cpp 23--- icu.org/source/common/rbbitblb.cpp 2017-01-20 01:20:31.000000000 +0100 24+++ icu/source/common/rbbitblb.cpp 2017-04-21 22:46:25.373651159 +0200 25@@ -1095,15 +1095,15 @@ 26 return 0; 27 } 28 29- size = sizeof(RBBIStateTable) - 4; // The header, with no rows to the table. 30+ size = offsetof(RBBIStateTable, fTableData); // The header, with no rows to the table. 31 32 numRows = fDStates->size(); 33 numCols = fRB->fSetBuilder->getNumCharCategories(); 34 35- // Note The declaration of RBBIStateTableRow is for a table of two columns. 36- // Therefore we subtract two from numCols when determining 37+ // Note The declaration of RBBIStateTableRow is for a table of one columns. 38+ // Therefore we subtract one from numCols when determining 39 // how much storage to add to a row for the total columns. 40- rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-2); 41+ rowSize = sizeof(RBBIStateTableRow) + sizeof(uint16_t)*(numCols-1); 42 size += numRows * rowSize; 43 return size; 44 } 45@@ -1133,7 +1133,7 @@ 46 } 47 48 table->fRowLen = sizeof(RBBIStateTableRow) + 49- sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 2); 50+ sizeof(uint16_t) * (fRB->fSetBuilder->getNumCharCategories() - 1); 51 table->fNumStates = fDStates->size(); 52 table->fFlags = 0; 53 if (fRB->fLookAheadHardBreak) { 54diff -ur icu.org/source/common/ubidiimp.h icu/source/common/ubidiimp.h 55--- icu.org/source/common/ubidiimp.h 2017-02-03 19:57:23.000000000 +0100 56+++ icu/source/common/ubidiimp.h 2017-04-21 22:46:25.374651159 +0200 57@@ -198,8 +198,8 @@ 58 /* in a Run, logicalStart will get this bit set if the run level is odd */ 59 #define INDEX_ODD_BIT (1UL<<31) 60 61-#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((int32_t)(level)<<31)) 62-#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((int32_t)(level)<<31)) 63+#define MAKE_INDEX_ODD_PAIR(index, level) ((index)|((uint32_t)(level)<<31)) 64+#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)(level)<<31)) 65 #define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT) 66 67 #define GET_INDEX(x) ((x)&~INDEX_ODD_BIT) 68diff -ur icu.org/source/common/ucmndata.cpp icu/source/common/ucmndata.cpp 69--- icu.org/source/common/ucmndata.cpp 2017-03-08 16:34:47.000000000 +0100 70+++ icu/source/common/ucmndata.cpp 2017-04-21 22:46:25.376651159 +0200 71@@ -77,7 +77,7 @@ 72 typedef struct { 73 uint32_t count; 74 uint32_t reserved; 75- PointerTOCEntry entry[2]; /* Actual size is from count. */ 76+ PointerTOCEntry entry[1]; /* Actual size is from count. */ 77 } PointerTOC; 78 79 80diff -ur icu.org/source/common/ucmndata.h icu/source/common/ucmndata.h 81--- icu.org/source/common/ucmndata.h 2017-01-20 01:20:31.000000000 +0100 82+++ icu/source/common/ucmndata.h 2017-04-21 22:46:25.377651159 +0200 83@@ -52,7 +52,7 @@ 84 85 typedef struct { 86 uint32_t count; 87- UDataOffsetTOCEntry entry[2]; /* Actual size of array is from count. */ 88+ UDataOffsetTOCEntry entry[1]; /* Actual size of array is from count. */ 89 } UDataOffsetTOC; 90 91 /** 92