diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index c0d56eb94..2aaac5473 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -705,11 +705,8 @@ final_reordering_syllable (hb_buffer_t *buffer, /* Find base again */ unsigned int base = end; - for (unsigned int i = start; i < end; i++) - if (info[i].indic_position() == POS_BASE_C) { - base = i; - break; - } + while (start < base && info[base - 1].indic_position() >= POS_BASE_C) + base--; unsigned int start_of_last_cluster = base; diff --git a/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt b/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt index 0d772a704..a8491bf1c 100644 --- a/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt +++ b/test/shaping/texts/in-tree/shaper-indic/indic/script-sinhala/misc/misc.txt @@ -4,3 +4,4 @@ කේ කෝ කෝ +ස්ට්‍රේ