summaryrefslogtreecommitdiff
path: root/external/libexttextcat
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-09-19 16:14:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-09-19 16:14:05 +0200
commit67141d8331f9cb85751a4747986774b53b7f4a77 (patch)
tree795d0128db7bdd5797c785aa8f3cf22f39a57345 /external/libexttextcat
parentbb826321b590ea793d0a225489b45e0c2c6ac237 (diff)
external/libexttextcat: Silence various -fsanitize=shift-base
...during 'instdir/program/soffice writerfilter/qa/cppunittests/rtftok/data/pass/EDB-18940-1.rtf' Change-Id: Icd5eb7b1f574e95b48b9d2fcb97d4157404dda13
Diffstat (limited to 'external/libexttextcat')
-rw-r--r--external/libexttextcat/UnpackedTarball_libexttextcat.mk3
-rw-r--r--external/libexttextcat/ubsan.patch40
2 files changed, 43 insertions, 0 deletions
diff --git a/external/libexttextcat/UnpackedTarball_libexttextcat.mk b/external/libexttextcat/UnpackedTarball_libexttextcat.mk
index 6b590f2fdf21..4009da04a01b 100644
--- a/external/libexttextcat/UnpackedTarball_libexttextcat.mk
+++ b/external/libexttextcat/UnpackedTarball_libexttextcat.mk
@@ -9,8 +9,11 @@
$(eval $(call gb_UnpackedTarball_UnpackedTarball,libexttextcat))
+$(eval $(call gb_UnpackedTarball_set_patchlevel,libexttextcat,0))
+
$(eval $(call gb_UnpackedTarball_add_patches,libexttextcat,\
external/libexttextcat/exttextcat-iOS.patch.1 \
+ external/libexttextcat/ubsan.patch \
))
$(eval $(call gb_UnpackedTarball_set_tarball,libexttextcat,$(LIBEXTTEXTCAT_TARBALL)))
diff --git a/external/libexttextcat/ubsan.patch b/external/libexttextcat/ubsan.patch
new file mode 100644
index 000000000000..767a9a003619
--- /dev/null
+++ b/external/libexttextcat/ubsan.patch
@@ -0,0 +1,40 @@
+--- src/fingerprint.c
++++ src/fingerprint.c
+@@ -128,7 +128,7 @@
+ */
+ static uint4 simplehash(const char *p, int len)
+ {
+- sint4 h = len * 13;
++ uint4 h = len * 13;
+ while (*p)
+ {
+ h = (h << 5) - h + *p++;
+--- src/utf8misc.c
++++ src/utf8misc.c
+@@ -61,7 +61,7 @@
+ * if the first bit of the current char is 1 then *str is an escape
+ * character
+ */
+- char escape_char = ((*str & WEIGHT_MASK) << 1);
++ unsigned char escape_char = ((*str & WEIGHT_MASK) << 1);
+
+ /*
+ * and we use it to count (by bit translation) following characters
+@@ -99,7 +99,7 @@
+ * then str[pointer] is an escape character and we use it to count
+ * following characters (only the weightest part)
+ */
+- char escape_char = ((str[pointer] & WEIGHT_MASK) << 1);
++ unsigned char escape_char = ((str[pointer] & WEIGHT_MASK) << 1);
+
+ /*
+ * every step, we move the byte of 1 bit left, when first bit is 0,
+@@ -138,7 +138,7 @@
+ * (only the weightest part)
+ */
+
+- char escape_char = ((key[pointer] & WEIGHT_MASK) << 1);
++ unsigned char escape_char = ((key[pointer] & WEIGHT_MASK) << 1);
+
+ while (escape_char & ESCAPE_MASK && key[pointer] == lex[pointer])
+ {