+ // When the last CE's low index is same with its high index, the CE is likely
+ // a part of expansion. In this case, the index is located just after the
+ // character corresponding to the CEs compared above. If the index is right
+ // at the break boundary, move the position to the next boundary will result
+ // incorrect match length when there are ignorable characters exist between
+ // the position and the next character produces CE(s). See ticket#8482.
+ if (minLimit == lastCEI.highOffset && target->isBreakBoundary(minLimit)) {
+ mLimit = minLimit;
+ } else {
+ int32_t nbb = target->nextBreakBoundary(minLimit);
+
+ if (nbb >= lastCEI.highOffset) {
+ mLimit = nbb;
+ }