From 48c5f26199808f40251cdaef7494456e9f23acb9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 21 Jan 2022 12:18:50 -0700 Subject: [PATCH] [unsafe-to-concat] Fix PairPos2 logic Test failures down from 8 to 6: 113/400 harfbuzz:shaping+in-house / mongolian-variation-selector FAIL 0.06s exit status 1 203/400 harfbuzz:shaping+aots / gpos3 FAIL 0.06s exit status 1 204/400 harfbuzz:shaping+aots / gpos4_lookupflag FAIL 0.06s exit status 1 260/400 harfbuzz:shaping+aots / gsub4_1_multiple_ligatures FAIL 0.06s exit status 1 264/400 harfbuzz:shaping+aots / lookupflag_ignore_attach FAIL 0.06s exit status 1 266/400 harfbuzz:shaping+aots / lookupflag_ignore_combination FAIL 0.06s exit status 1 --- src/hb-ot-layout-gpos-table.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index bd1577fbb..af91f2aaf 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1574,7 +1574,11 @@ struct PairPosFormat2 unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint); unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint); - if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return_trace (false); + if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) + { + buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); + return_trace (false); + } const Value *v = &values[record_len * (klass1 * class2Count + klass2)]; @@ -1642,9 +1646,9 @@ struct PairPosFormat2 if (applied_first || applied_second) buffer->unsafe_to_break (buffer->idx, skippy_iter.idx + 1); else - buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); - boring: + buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1); + buffer->idx = skippy_iter.idx; if (len2)