[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Oct 26 17:33:46 UTC 2017


 src/hb-set-private.hh |    4 ++--
 test/api/test-set.c   |   18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

New commits:
commit dfd234a97d2e2f9908eaf0598de765f76ba86c82
Author: Jonathan Kew <jfkthame at gmail.com>
Date:   Thu Oct 26 16:59:50 2017 +0100

    [set] Fix page_map[] indexing in backward loop.
    
    Fixes https://github.com/behdad/harfbuzz/issues/579.

diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index df4325af..c970b89d 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -313,13 +313,13 @@ struct hb_set_t
     b = nb;
     for (; a && b; )
     {
-      if (page_map[a].major == other->page_map[b].major)
+      if (page_map[a - 1].major == other->page_map[b - 1].major)
       {
 	a--;
 	b--;
         Op::process (page_at (--count).v, page_at (a).v, other->page_at (b).v);
       }
-      else if (page_map[a].major > other->page_map[b].major)
+      else if (page_map[a - 1].major > other->page_map[b - 1].major)
       {
         a--;
         if (Op::passthru_left)
commit 7339926525416620aa7922371775ed65eed4eae4
Author: Jonathan Kew <jfkthame at gmail.com>
Date:   Thu Oct 26 12:55:36 2017 +0100

    [test] Extend hb_set test for issue 579 (currently failing)

diff --git a/test/api/test-set.c b/test/api/test-set.c
index b3dc35ef..d9cb1b01 100644
--- a/test/api/test-set.c
+++ b/test/api/test-set.c
@@ -188,6 +188,24 @@ test_set_algebra (void)
   g_assert (hb_set_has (o, 888));
   g_assert (hb_set_has (o, 889));
 
+  hb_set_clear (s);
+  test_empty (s);
+  hb_set_add_range (s, 886, 895);
+  hb_set_add (s, 1014);
+  hb_set_add (s, 1017);
+  hb_set_add (s, 1024);
+  hb_set_add (s, 1113);
+  hb_set_add (s, 1121);
+  g_assert_cmpint (hb_set_get_population (s), ==, 15);
+
+  hb_set_clear (o);
+  test_empty (o);
+  hb_set_add (o, 889);
+  g_assert_cmpint (hb_set_get_population (o), ==, 1);
+  hb_set_intersect (o, s);
+  g_assert_cmpint (hb_set_get_population (o), ==, 1);
+  g_assert (hb_set_has (o, 889));
+
   hb_set_destroy (s);
   hb_set_destroy (o);
 }


More information about the HarfBuzz mailing list