texlive[67801] Build/source/libs: harfbuzz 8.1.1

commits+kakuto at tug.org commits+kakuto at tug.org
Thu Aug 3 04:50:52 CEST 2023


Revision: 67801
          http://tug.org/svn/texlive?view=revision&revision=67801
Author:   kakuto
Date:     2023-08-03 04:50:52 +0200 (Thu, 03 Aug 2023)
Log Message:
-----------
harfbuzz 8.1.1

Modified Paths:
--------------
    trunk/Build/source/libs/README
    trunk/Build/source/libs/harfbuzz/ChangeLog
    trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog
    trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes
    trunk/Build/source/libs/harfbuzz/configure
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/CursivePosFormat1.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSet.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh
    trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-sanitize.hh
    trunk/Build/source/libs/harfbuzz/version.ac

Modified: trunk/Build/source/libs/README
===================================================================
--- trunk/Build/source/libs/README	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/README	2023-08-03 02:50:52 UTC (rev 67801)
@@ -25,8 +25,8 @@
   http://sourceforge.net/projects/silgraphite/files/graphite2/
   (requires C++11)
 
-harfbuzz 8.1.0 - checked 01aug23
-  https://github.com/harfbuzz/harfbuzz/releases/tag/8.1.0
+harfbuzz 8.1.1 - checked 03aug23
+  https://github.com/harfbuzz/harfbuzz/releases/tag/8.1.1
 
 icu 72.1 - checked 07jan23
   https://github.com/unicode-org/icu/releases/

Modified: trunk/Build/source/libs/harfbuzz/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/ChangeLog	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/ChangeLog	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,3 +1,8 @@
+2023-08-03  Akira Kakuto  <kakuto at jcom.zaq.ne.jp>
+
+	Import harfbuzz-8.1.1.
+	* version.ac: Adjusted.
+
 2023-08-01  Akira Kakuto  <kakuto at jcom.zaq.ne.jp>
 
 	Import harfbuzz-8.1.0.

Modified: trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/TLpatches/ChangeLog	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,3 +1,8 @@
+2023-08-03  Akira Kakuto  <kakuto at jcom.zaq.ne.jp>
+
+	Imported harfbuzz-8.1.1 source tree from:
+	https://github.com/harfbuzz/harfbuzz/releases/download/8.1.1/
+
 2023-08-01  Akira Kakuto  <kakuto at jcom.zaq.ne.jp>
 
 	Imported harfbuzz-8.1.0 source tree from:

Modified: trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/TLpatches/TL-Changes	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,5 +1,5 @@
-Changes applied to the harfbuzz-8.1.0/ tree as obtained from:
-	https://github.com/harfbuzz/harfbuzz/releases/download/8.1.0/
+Changes applied to the harfbuzz-8.1.1/ tree as obtained from:
+	https://github.com/harfbuzz/harfbuzz/releases/download/8.1.1/
 
 Removed:
 	COPYING

Modified: trunk/Build/source/libs/harfbuzz/configure
===================================================================
--- trunk/Build/source/libs/harfbuzz/configure	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/configure	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for harfbuzz (TeX Live) 8.1.0.
+# Generated by GNU Autoconf 2.71 for harfbuzz (TeX Live) 8.1.1.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -611,8 +611,8 @@
 # Identity of this package.
 PACKAGE_NAME='harfbuzz (TeX Live)'
 PACKAGE_TARNAME='harfbuzz--tex-live-'
-PACKAGE_VERSION='8.1.0'
-PACKAGE_STRING='harfbuzz (TeX Live) 8.1.0'
+PACKAGE_VERSION='8.1.1'
+PACKAGE_STRING='harfbuzz (TeX Live) 8.1.1'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1346,7 +1346,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures harfbuzz (TeX Live) 8.1.0 to adapt to many kinds of systems.
+\`configure' configures harfbuzz (TeX Live) 8.1.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1418,7 +1418,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of harfbuzz (TeX Live) 8.1.0:";;
+     short | recursive ) echo "Configuration of harfbuzz (TeX Live) 8.1.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1523,7 +1523,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-harfbuzz (TeX Live) configure 8.1.0
+harfbuzz (TeX Live) configure 8.1.1
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2064,7 +2064,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by harfbuzz (TeX Live) $as_me 8.1.0, which was
+It was created by harfbuzz (TeX Live) $as_me 8.1.1, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -4823,7 +4823,7 @@
 
 # Define the identity of the package.
  PACKAGE='harfbuzz--tex-live-'
- VERSION='8.1.0'
+ VERSION='8.1.1'
 
 
 # Some tools Automake needs.
@@ -5035,8 +5035,8 @@
 
 HB_VERSION_MAJOR=8
 HB_VERSION_MINOR=1
-HB_VERSION_MICRO=0
-HB_VERSION=8.1.0
+HB_VERSION_MICRO=1
+HB_VERSION=8.1.1
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -8817,7 +8817,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by harfbuzz (TeX Live) $as_me 8.1.0, which was
+This file was extended by harfbuzz (TeX Live) $as_me 8.1.1, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -8885,7 +8885,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-harfbuzz (TeX Live) config.status 8.1.0
+harfbuzz (TeX Live) config.status 8.1.1
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/ChangeLog	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,3 +1,226 @@
+commit 1d665c2b521512cdd56964138fc601debd1f1177
+Author: Khaled Hosny <khaled at aliftype.com>
+Date:   Wed Aug 2 23:44:56 2023 +0300
+
+    8.1.1
+
+ NEWS             | 8 ++++++++
+ configure.ac     | 2 +-
+ meson.build      | 2 +-
+ src/hb-version.h | 4 ++--
+ 4 files changed, 12 insertions(+), 4 deletions(-)
+
+commit 91c449a64a6924afd2aee4d3eb0b80c8c7d9ad07
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Wed Aug 2 14:40:55 2023 -0600
+
+    [graph] Make space_for non-recursive
+    
+    It was tail-recursive so perhaps the compiler did the same.
+    Anyway, make it explicit now.
+
+ src/graph/graph.hh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+commit dcd3afcabfeb447a075b189f20cd523e177a0a9d
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 20:09:34 2023 -0600
+
+    [skippy-iter] Remove unused num_items
+
+ src/OT/Layout/GPOS/CursivePosFormat1.hh  |  2 +-
+ src/OT/Layout/GPOS/MarkMarkPosFormat1.hh |  2 +-
+ src/OT/Layout/GPOS/PairPosFormat1.hh     |  2 +-
+ src/OT/Layout/GPOS/PairPosFormat2.hh     |  2 +-
+ src/OT/Layout/GSUB/LigatureSet.hh        |  2 +-
+ src/hb-kern.hh                           |  2 +-
+ src/hb-ot-layout-gsubgpos.hh             | 24 +++++++-----------------
+ 7 files changed, 13 insertions(+), 23 deletions(-)
+
+commit 5b337130e28eeaef3b5cfe884b514059417e3384
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 20:02:21 2023 -0600
+
+    Add test for previous commit
+
+ .../fonts/bef923f4ccb474f961c43b63a9c74b7d9b7a023f.ttf   | Bin 0 -> 2180 bytes
+ test/shape/data/in-house/tests/context-matching.tests    |   1 +
+ 2 files changed, 1 insertion(+)
+
+commit 39048099cb421095e24cdcc027b9cdc2a7fcf93e
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 19:41:12 2023 -0600
+
+    [skippy-iter] Remove early stop
+    
+    The optimization in (Chain)RuleSet matching relies on
+    matching one, even if num_items is out of range.
+    
+    Fixes https://github.com/harfbuzz/harfbuzz/issues/4358
+
+ src/hb-ot-layout-gsubgpos.hh | 12 ++----------
+ 1 file changed, 2 insertions(+), 10 deletions(-)
+
+commit 70b3fbed2850f310658b65a68a058232b78ebeee
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 15:16:16 2023 -0600
+
+    [graph] Fix invalid read when map gets resized
+    
+    I don't fully understand how the old code was wrong, since
+    *v should be evaluated before the set() method call.
+    Yet this seems to fix a bug that could be reproduced
+    with HB_DEBUG_SUBSET_REPACK enabled and the following:
+    
+    $ hb-repacker-fuzzer test/fuzzing/graphs/clusterfuzz-testcase-minimized-hb-repacker-fuzzer-6419865171525632
+
+ src/graph/graph.hh | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+commit 94d4283b12037d66ceb3b195f47d3bca96eb6627
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 15:05:17 2023 -0600
+
+    [graph] Handle a malloc fail
+    
+    Fixes https://oss-fuzz.com/testcase-detail/4579249263345664
+
+ src/graph/graph.hh                                   |  19 ++++++++++++-------
+ ...ase-minimized-hb-repacker-fuzzer-4579249263345664 | Bin 0 -> 173466 bytes
+ 2 files changed, 12 insertions(+), 7 deletions(-)
+
+commit 603920e911dc0fde79dc0ddde2be393f5c123d30
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 14:58:33 2023 -0600
+
+    [graph] Minor asserts
+
+ src/graph/graph.hh | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit 8d00476fbf99f770608644e424712cf95d3950b8
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 14:27:37 2023 -0600
+
+    [graph] Minor restructure a condition
+
+ src/graph/graph.hh | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+commit 7946984b9624338b8d15fa53ac21664a734e93d3
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 14:18:03 2023 -0600
+
+    [graph] More assert
+
+ src/graph/graph.hh | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+commit 3b386c3773f24e30ec26bbbf86422ac67a6fb7b9
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 14:12:43 2023 -0600
+
+    [graph] Minor assert
+
+ src/graph/graph.hh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+commit 07e7033076d9acfeeaa7a91ea878fa130a022824
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 12:25:45 2023 -0600
+
+    [graph] Error check
+
+ src/graph/graph.hh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+commit 7a9aac1ae3f7b836ddb314636d6f50d8ad7ec5d2
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Tue Aug 1 12:05:22 2023 -0600
+
+    [graph] Fixes to parent handling
+
+ src/graph/graph.hh | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+commit 2feac50b40f1dff06655c8efcadcc55088b34dad
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 19:53:06 2023 -0600
+
+    Revert "[gsubgpos] Keep another digest in the applicable_t"
+    
+    This reverts commit fd79c7cecdf68fe4626943f29bd5edf1e603d2b2.
+
+ src/hb-ot-layout-gsubgpos.hh | 32 ++++++++++----------------------
+ 1 file changed, 10 insertions(+), 22 deletions(-)
+
+commit fd79c7cecdf68fe4626943f29bd5edf1e603d2b2
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 19:52:15 2023 -0600
+
+    [gsubgpos] Keep another digest in the applicable_t
+    
+    The digest for all the remaining subtables combined.
+    The idea is to get out of the subtable look as soon as
+    no more can be applied.
+    
+    Doesn't seem to speed up anything I tested. Going to revert.
+
+ src/hb-ot-layout-gsubgpos.hh | 32 ++++++++++++++++++++++----------
+ 1 file changed, 22 insertions(+), 10 deletions(-)
+
+commit e3fd69c88958fead68a62cecef7454990f7757fd
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 19:07:42 2023 -0600
+
+    [layout] Inline another function
+    
+    Code is smaller too.
+
+ src/hb-ot-layout-gsubgpos.hh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 9cdc043c16d319268677a9098c83dc572d279c99
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 18:53:29 2023 -0600
+
+    [Cursive] Only sanitize what we use
+
+ src/OT/Layout/GPOS/CursivePosFormat1.hh | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+commit 25e9defa516d63b12a659282a13dc9e1fe522cc8
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 17:12:07 2023 -0600
+
+    [sanitize] Inline check_struct
+    
+    Though seems like the compiler was always inlining it anyway.
+
+ src/hb-sanitize.hh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+commit 44026aa8a992b7105a615f1fbaaf0e342b634efa
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 16:47:06 2023 -0600
+
+    [Cursive] Minor, adjust unsafe-to-concat if prev didn't sanitize
+
+ src/OT/Layout/GPOS/CursivePosFormat1.hh | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+commit b382e616cc807fe16da0fe7baca6dc2335fab987
+Author: Behdad Esfahbod <behdad at behdad.org>
+Date:   Mon Jul 31 16:29:28 2023 -0600
+
+    [GPOS] Sanitize Cursive positioning anchors lazily
+    
+    Speeds up Duployan-Regular.otf load time by 30%.
+    Doesn't seem to slow down shaping in a measurable way.
+
+ src/OT/Layout/GPOS/CursivePosFormat1.hh | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
 commit fcb9e5915f5d20b20576612efd4ee15d9da04c8a
 Author: Khaled Hosny <khaled at aliftype.com>
 Date:   Tue Aug 1 00:57:06 2023 +0300

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/NEWS	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,3 +1,11 @@
+Overview of changes leading to 8.1.1
+Wednesday, August 2, 2023
+====================================
+- Fix shaping of contextual rules at the end of string, introduced in 8.1.0
+- Fix stack-overflow in repacker with malicious fonts.
+- 30% speed up loading Noto Duployan font.
+
+
 Overview of changes leading to 8.1.0
 Tuesday, August 1, 2023
 ====================================

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/configure.ac	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,6 +1,6 @@
 AC_PREREQ([2.64])
 AC_INIT([HarfBuzz],
-        [8.1.0],
+        [8.1.1],
         [https://github.com/harfbuzz/harfbuzz/issues/new],
         [harfbuzz],
         [http://harfbuzz.org/])

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/meson.build	2023-08-03 02:50:52 UTC (rev 67801)
@@ -1,6 +1,6 @@
 project('harfbuzz', 'c', 'cpp',
   meson_version: '>= 0.55.0',
-  version: '8.1.0',
+  version: '8.1.1',
   default_options: [
     'cpp_eh=none',          # Just to support msvc, we are passing -fno-exceptions also anyway
     'cpp_rtti=false',       # Just to support msvc, we are passing -fno-rtti also anyway

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/CursivePosFormat1.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/CursivePosFormat1.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/CursivePosFormat1.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -91,7 +91,13 @@
   bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
+    if (unlikely (!coverage.sanitize (c, this)))
+      return_trace (false);
+
+    if (c->lazy_some_gpos)
+      return_trace (entryExitRecord.sanitize_shallow (c));
+    else
+      return_trace (entryExitRecord.sanitize (c, this));
   }
 
   bool intersects (const hb_set_t *glyphs) const
@@ -119,10 +125,11 @@
     hb_buffer_t *buffer = c->buffer;
 
     const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage  (buffer->cur().codepoint)];
-    if (!this_record.entryAnchor) return_trace (false);
+    if (!this_record.entryAnchor ||
+	unlikely (!this_record.entryAnchor.sanitize (&c->sanitizer, this))) return_trace (false);
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset_fast (buffer->idx, 1);
+    skippy_iter.reset_fast (buffer->idx);
     unsigned unsafe_from;
     if (unlikely (!skippy_iter.prev (&unsafe_from)))
     {
@@ -131,7 +138,8 @@
     }
 
     const EntryExitRecord &prev_record = entryExitRecord[(this+coverage).get_coverage  (buffer->info[skippy_iter.idx].codepoint)];
-    if (!prev_record.exitAnchor)
+    if (!prev_record.exitAnchor ||
+	unlikely (!prev_record.exitAnchor.sanitize (&c->sanitizer, this)))
     {
       buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1);
       return_trace (false);

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/MarkMarkPosFormat1.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -100,7 +100,7 @@
 
     /* now we search backwards for a suitable mark glyph until a non-mark glyph */
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset_fast (buffer->idx, 1);
+    skippy_iter.reset_fast (buffer->idx);
     skippy_iter.set_lookup_props (c->lookup_props & ~(uint32_t)LookupFlag::IgnoreFlags);
     unsigned unsafe_from;
     if (unlikely (!skippy_iter.prev (&unsafe_from)))

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat1.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -110,7 +110,7 @@
     if (likely (index == NOT_COVERED)) return_trace (false);
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset_fast (buffer->idx, 1);
+    skippy_iter.reset_fast (buffer->idx);
     unsigned unsafe_to;
     if (unlikely (!skippy_iter.next (&unsafe_to)))
     {

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GPOS/PairPosFormat2.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -131,7 +131,7 @@
     if (likely (index == NOT_COVERED)) return_trace (false);
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset_fast (buffer->idx, 1);
+    skippy_iter.reset_fast (buffer->idx);
     unsigned unsafe_to;
     if (unlikely (!skippy_iter.next (&unsafe_to)))
     {

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSet.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSet.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/OT/Layout/GSUB/LigatureSet.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -97,7 +97,7 @@
      * This is replicated in ChainRuleSet and RuleSet. */
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset (c->buffer->idx, 1);
+    skippy_iter.reset (c->buffer->idx);
     skippy_iter.set_match_func (match_always, nullptr);
     skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
     unsigned unsafe_to;

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/graph/graph.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -187,6 +187,11 @@
 
     unsigned incoming_edges () const
     {
+      if (HB_DEBUG_SUBSET_REPACK)
+       {
+	assert (incoming_edges_ == (single_parent != (unsigned) -1) +
+		(parents.values_ref () | hb_reduce (hb_add, 0)));
+       }
       return incoming_edges_;
     }
 
@@ -199,6 +204,7 @@
 
     void add_parent (unsigned parent_index)
     {
+      assert (parent_index != (unsigned) -1);
       if (incoming_edges_ == 0)
       {
 	single_parent = parent_index;
@@ -207,13 +213,20 @@
       }
       else if (single_parent != (unsigned) -1)
       {
+        assert (incoming_edges_ == 1);
 	if (!parents.set (single_parent, 1))
 	  return;
 	single_parent = (unsigned) -1;
       }
 
-      if (parents.set (parent_index, parents[parent_index] + 1))
+      unsigned *v;
+      if (parents.has (parent_index, &v))
+      {
+        (*v)++;
 	incoming_edges_++;
+      }
+      else if (parents.set (parent_index, 1))
+	incoming_edges_++;
     }
 
     void remove_parent (unsigned parent_index)
@@ -230,7 +243,7 @@
       {
 	incoming_edges_--;
 	if (*v > 1)
-	  *v -= 1;
+	  (*v)--;
 	else
 	  parents.del (parent_index);
 
@@ -259,20 +272,29 @@
       }
     }
 
-    void remap_parents (const hb_vector_t<unsigned>& id_map)
+    bool remap_parents (const hb_vector_t<unsigned>& id_map)
     {
       if (single_parent != (unsigned) -1)
       {
+        assert (single_parent < id_map.length);
 	single_parent = id_map[single_parent];
-	return;
+	return true;
       }
 
       hb_hashmap_t<unsigned, unsigned> new_parents;
       new_parents.alloc (parents.get_population ());
       for (auto _ : parents)
-        new_parents.set (id_map[_.first], _.second);
+      {
+	assert (_.first < id_map.length);
+	assert (!new_parents.has (id_map[_.first]));
+	new_parents.set (id_map[_.first], _.second);
+      }
 
+      if (new_parents.in_error ())
+        return false;
+
       parents = std::move (new_parents);
+      return true;
     }
 
     void remap_parent (unsigned old_index, unsigned new_index)
@@ -284,10 +306,12 @@
         return;
       }
 
-      if (parents.has (old_index))
+      const unsigned *pv;
+      if (parents.has (old_index, &pv))
       {
-	remove_parent (old_index);
-	add_parent (new_index);
+        unsigned v = *pv;
+	parents.set (new_index, v);
+	parents.del (old_index);
       }
     }
 
@@ -568,7 +592,7 @@
     check_success (!queue.in_error ());
     check_success (!sorted_graph.in_error ());
 
-    remap_all_obj_indices (id_map, &sorted_graph);
+    check_success (remap_all_obj_indices (id_map, &sorted_graph));
     vertices_ = std::move (sorted_graph);
 
     if (!check_success (new_id == -1))
@@ -763,6 +787,8 @@
       subgraph.set (root_idx, wide_parents (root_idx, parents));
       find_subgraph (root_idx, subgraph);
     }
+    if (subgraph.in_error ())
+      return false;
 
     unsigned original_root_idx = root_idx ();
     hb_map_t index_map;
@@ -769,6 +795,7 @@
     bool made_changes = false;
     for (auto entry : subgraph.iter ())
     {
+      assert (entry.first < vertices_.length);
       const auto& node = vertices_[entry.first];
       unsigned subgraph_incoming_edges = entry.second;
 
@@ -1192,6 +1219,8 @@
 
   unsigned space_for (unsigned index, unsigned* root = nullptr) const
   {
+  loop:
+    assert (index < vertices_.length);
     const auto& node = vertices_[index];
     if (node.space)
     {
@@ -1207,7 +1236,8 @@
       return 0;
     }
 
-    return space_for (*node.parents_iter (), root);
+    index = *node.parents_iter ();
+    goto loop;
   }
 
   void err_other_error () { this->successful = false; }
@@ -1267,9 +1297,7 @@
     for (unsigned p = 0; p < count; p++)
     {
       for (auto& l : vertices_.arrayZ[p].obj.all_links ())
-      {
         vertices_[l.objidx].add_parent (p);
-      }
     }
 
     for (unsigned i = 0; i < count; i++)
@@ -1404,18 +1432,20 @@
   /*
    * Updates all objidx's in all links using the provided mapping.
    */
-  void remap_all_obj_indices (const hb_vector_t<unsigned>& id_map,
+  bool remap_all_obj_indices (const hb_vector_t<unsigned>& id_map,
                               hb_vector_t<vertex_t>* sorted_graph) const
   {
     unsigned count = sorted_graph->length;
     for (unsigned i = 0; i < count; i++)
     {
-      (*sorted_graph)[i].remap_parents (id_map);
+      if (!(*sorted_graph)[i].remap_parents (id_map))
+        return false;
       for (auto& link : sorted_graph->arrayZ[i].obj.all_links_writer ())
       {
         link.objidx = id_map[link.objidx];
       }
     }
+    return true;
   }
 
   /*

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-kern.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -70,7 +70,7 @@
 	continue;
       }
 
-      skippy_iter.reset (idx, 1);
+      skippy_iter.reset (idx);
       unsigned unsafe_to;
       if (!skippy_iter.next (&unsafe_to))
       {

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsubgpos.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -518,11 +518,9 @@
 #ifndef HB_OPTIMIZE_SIZE
     HB_ALWAYS_INLINE
 #endif
-    void reset (unsigned int start_index_,
-		unsigned int num_items_)
+    void reset (unsigned int start_index_)
     {
       idx = start_index_;
-      num_items = num_items_;
       end = c->buffer->len;
       matcher.set_syllable (start_index_ == c->buffer->idx ? c->buffer->cur().syllable () : 0);
     }
@@ -530,17 +528,14 @@
 #ifndef HB_OPTIMIZE_SIZE
     HB_ALWAYS_INLINE
 #endif
-    void reset_fast (unsigned int start_index_,
-		     unsigned int num_items_)
+    void reset_fast (unsigned int start_index_)
     {
       // Doesn't set end or syllable. Used by GPOS which doesn't care / change.
       idx = start_index_;
-      num_items = num_items_;
     }
 
     void reject ()
     {
-      num_items++;
       backup_glyph_data ();
     }
 
@@ -583,12 +578,7 @@
 #endif
     bool next (unsigned *unsafe_to = nullptr)
     {
-      assert (num_items > 0);
-      /* The alternate condition below is faster at string boundaries,
-       * but produces subpar "unsafe-to-concat" values. */
-      signed stop = (signed) end - (signed) num_items;
-      if (c->buffer->flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT)
-        stop = (signed) end - 1;
+      const signed stop = (signed) end - 1;
       while ((signed) idx < stop)
       {
 	idx++;
@@ -596,7 +586,6 @@
 	{
 	  case MATCH:
 	  {
-	    num_items--;
 	    advance_glyph_data ();
 	    return true;
 	  }
@@ -619,12 +608,7 @@
 #endif
     bool prev (unsigned *unsafe_from = nullptr)
     {
-      assert (num_items > 0);
-      /* The alternate condition below is faster at string boundaries,
-       * but produces subpar "unsafe-to-concat" values. */
-      unsigned stop = num_items - 1;
-      if (c->buffer->flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT)
-        stop = 1 - 1;
+      const unsigned stop = 0;
       while (idx > stop)
       {
 	idx--;
@@ -632,7 +616,6 @@
 	{
 	  case MATCH:
 	  {
-	    num_items--;
 	    advance_glyph_data ();
 	    return true;
 	  }
@@ -691,7 +674,6 @@
     const HBUINT24 *match_glyph_data24;
 #endif
 
-    unsigned int num_items;
     unsigned int end;
   };
 
@@ -1283,7 +1265,7 @@
   hb_buffer_t *buffer = c->buffer;
 
   hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-  skippy_iter.reset (buffer->idx, count - 1);
+  skippy_iter.reset (buffer->idx);
   skippy_iter.set_match_func (match_func, match_data);
   skippy_iter.set_glyph_data (input);
 
@@ -1523,7 +1505,7 @@
   TRACE_APPLY (nullptr);
 
   hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
-  skippy_iter.reset (c->buffer->backtrack_len (), count);
+  skippy_iter.reset (c->buffer->backtrack_len ());
   skippy_iter.set_match_func (match_func, match_data);
   skippy_iter.set_glyph_data (backtrack);
 
@@ -1556,7 +1538,7 @@
   TRACE_APPLY (nullptr);
 
   hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_context;
-  skippy_iter.reset (start_index - 1, count);
+  skippy_iter.reset (start_index - 1);
   skippy_iter.set_match_func (match_func, match_data);
   skippy_iter.set_glyph_data (lookahead);
 
@@ -2175,7 +2157,7 @@
      * Replicated from LigatureSet::apply(). */
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset (c->buffer->idx, 2);
+    skippy_iter.reset (c->buffer->idx);
     skippy_iter.set_match_func (match_always, nullptr);
     skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
     unsigned unsafe_to = (unsigned) -1, unsafe_to1 = 0, unsafe_to2 = 0;
@@ -3346,7 +3328,7 @@
      * Replicated from LigatureSet::apply(). */
 
     hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
-    skippy_iter.reset (c->buffer->idx, 2);
+    skippy_iter.reset (c->buffer->idx);
     skippy_iter.set_match_func (match_always, nullptr);
     skippy_iter.set_glyph_data ((HBUINT16 *) nullptr);
     unsigned unsafe_to = (unsigned) -1, unsafe_to1 = 0, unsafe_to2 = 0;
@@ -4353,6 +4335,9 @@
   bool may_have (hb_codepoint_t g) const
   { return digest.may_have (g); }
 
+#ifndef HB_OPTIMIZE_SIZE
+  HB_ALWAYS_INLINE
+#endif
   bool apply (hb_ot_apply_context_t *c, unsigned subtables_count, bool use_cache) const
   {
 #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE

Modified: trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-sanitize.hh
===================================================================
--- trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-sanitize.hh	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-sanitize.hh	2023-08-03 02:50:52 UTC (rev 67801)
@@ -382,6 +382,9 @@
   }
 
   template <typename Type>
+#ifndef HB_OPTIMIZE_SIZE
+  HB_ALWAYS_INLINE
+#endif
   bool check_struct (const Type *obj) const
   {
     if (sizeof (uintptr_t) == sizeof (uint32_t))

Modified: trunk/Build/source/libs/harfbuzz/version.ac
===================================================================
--- trunk/Build/source/libs/harfbuzz/version.ac	2023-08-02 23:43:30 UTC (rev 67800)
+++ trunk/Build/source/libs/harfbuzz/version.ac	2023-08-03 02:50:52 UTC (rev 67801)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current harfbuzz version
-m4_define([harfbuzz_version], [8.1.0])
+m4_define([harfbuzz_version], [8.1.1])



More information about the tex-live-commits mailing list.