summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-01-06 18:05:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-01-06 18:06:11 +0100
commit9dbac35b1e55c49b2f1e595f4dfe3437c3fedb58 (patch)
tree8abef4dc0da20f3dda622e67a4f00d57fac85192 /external
parente2883ca86f747eb62d1fe9e9b8d115c689e3abd7 (diff)
external/harfbuzz: Work around -fsanitize=null
Change-Id: I81dc29f5ba2ef442ffb7e2823f02b9bfead24a46
Diffstat (limited to 'external')
-rw-r--r--external/harfbuzz/UnpackedTarball_harfbuzz.mk6
-rw-r--r--external/harfbuzz/ubsan.patch44
2 files changed, 50 insertions, 0 deletions
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk
index 0bda2a186e2a..1f9f15f355c0 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 000000000000..3bdb589a1f66
--- /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,