[Libreoffice-commits] core.git: external/harfbuzz

Stephan Bergmann sbergman at redhat.com
Tue Jan 6 09:06:46 PST 2015


 external/harfbuzz/UnpackedTarball_harfbuzz.mk |    6 +++
 external/harfbuzz/ubsan.patch                 |   44 ++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

New commits:
commit 9dbac35b1e55c49b2f1e595f4dfe3437c3fedb58
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 6 18:05:49 2015 +0100

    external/harfbuzz: Work around -fsanitize=null
    
    Change-Id: I81dc29f5ba2ef442ffb7e2823f02b9bfead24a46

diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 0bda2a1..1f9f15f 100644
--- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk
+++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,harfbuzz))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,harfbuzz,$(HARFBUZZ_TARBALL),,harfbuzz))
 
+$(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \
+    external/harfbuzz/ubsan.patch \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/harfbuzz/ubsan.patch b/external/harfbuzz/ubsan.patch
new file mode 100644
index 0000000..3bdb589
--- /dev/null
+++ b/external/harfbuzz/ubsan.patch
@@ -0,0 +1,44 @@
+--- src/hb-object-private.hh
++++ src/hb-object-private.hh
+@@ -131,7 +131,7 @@
+   }
+ 
+   inline bool destroy (void) {
+-    if (unlikely (!this || this->is_inert ()))
++    if (unlikely (is_inert ()))
+       return false;
+     if (ref_count.dec () != 1)
+       return false;
+@@ -160,13 +160,12 @@
+   }
+ 
+   inline void trace (const char *function) const {
+-    if (unlikely (!this)) return;
+     /* TODO We cannot use DEBUG_MSG_FUNC here since that one currently only
+      * prints the class name and throws away the template info. */
+     DEBUG_MSG (OBJECT, (void *) this,
+ 	       "%s refcount=%d",
+ 	       function,
+-	       this ? ref_count.ref_count : 0);
++	       ref_count.ref_count);
+   }
+ 
+   private:
+@@ -179,7 +179,7 @@
+ template <typename Type>
+ static inline void hb_object_trace (const Type *obj, const char *function)
+ {
+-  obj->header.trace (function);
++  if (likely (obj)) obj->header.trace (function);
+ }
+ template <typename Type>
+ static inline Type *hb_object_create (void)
+@@ -204,7 +204,7 @@
+ static inline bool hb_object_destroy (Type *obj)
+ {
+   hb_object_trace (obj, HB_FUNC);
+-  return obj->header.destroy ();
++  return likely (obj) && obj->header.destroy ();
+ }
+ template <typename Type>
+ static inline bool hb_object_set_user_data (Type               *obj,


More information about the Libreoffice-commits mailing list