diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-08-16 08:52:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-08-16 08:52:26 +0200 |
commit | 014c30d12945f3c48e3b4758a01fa0721d1ec3c3 (patch) | |
tree | 76defd9b4a0c2e8d80936478f94975fc188d0f17 /external/harfbuzz | |
parent | b6e0fcf85696b65aff160661a6f89d84a4e27962 (diff) |
Re-add external/harfbuzz/ubsan.patch
...after 5aab2900dfdc9f12adda378470149670a2a069df "tdf#109142: Update to
HarfBuzz 1.4.8". The parts that were still relevant for 'make check' are:
* 6694ce6b542367074667e4445a6b7f50568a2729 "external/harfbuzz: Work around ASan
out of bounds warning"
* 99f7aacd5b39a0f79351d8d7568b2e43d39878cb "external/harfbuzz:
-fsanitize=function"
* ca9a08bbf7d42727a93b5f725784308a3590c0fe "external/harfbuzz: Silence
-fsanitize=nonnull-attribute" (plus 83a9c8e046dfcaccdb1114ec5a386a11fcca3a02
"build fix")
Change-Id: Ibff2a7c52c5de60ae00744acd2ef481bbb08706c
Diffstat (limited to 'external/harfbuzz')
-rw-r--r-- | external/harfbuzz/UnpackedTarball_harfbuzz.mk | 1 | ||||
-rw-r--r-- | external/harfbuzz/ubsan.patch | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk index 178627a32574..9a2967220e25 100644 --- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk +++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk @@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0)) $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \ external/harfbuzz/clang-cl.patch \ + external/harfbuzz/ubsan.patch \ )) ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE) diff --git a/external/harfbuzz/ubsan.patch b/external/harfbuzz/ubsan.patch new file mode 100644 index 000000000000..b855d5f2140d --- /dev/null +++ b/external/harfbuzz/ubsan.patch @@ -0,0 +1,32 @@ +--- src/hb-ot-font.cc ++++ src/hb-ot-font.cc +@@ -138,7 +138,7 @@ + return this->default_advance; + } + +- return this->table->longMetric[MIN (glyph, (uint32_t) this->num_advances - 1)].advance ++ return static_cast<OT::LongMetric const *>(this->table->longMetric)[MIN (glyph, (uint32_t) this->num_advances - 1)].advance + + this->var->get_advance_var (glyph, font->coords, font->num_coords); // TODO Optimize?! + } + }; +@@ -458,8 +458,9 @@ + } + + static void +-_hb_ot_font_destroy (hb_ot_font_t *ot_font) ++_hb_ot_font_destroy (void *ot_font_) + { ++ hb_ot_font_t *ot_font = static_cast<hb_ot_font_t *>(ot_font_); + ot_font->cmap.fini (); + ot_font->h_metrics.fini (); + ot_font->v_metrics.fini (); +--- src/hb-private.hh ++++ src/hb-private.hh +@@ -461,6 +461,7 @@ + template <typename T> + inline const Type *bsearch (T *key) const + { ++ if (len == 0) return NULL; + return (const Type *) ::bsearch (key, array, len, sizeof (Type), (hb_compare_func_t) Type::cmp); + } + |