summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-24 15:37:08 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-24 21:22:01 +0100
commit771a256685ca44481252fac6854e88ff6630298d (patch)
tree8506c70f6cd331b79ffd152043dc3139c784d5eb
parent0154f04e8c64df937b793c73ac58d553637f324f (diff)
ofz#30767 Build-Failure
similar to commit 63a9b50a7a062069af3e3bcf05657164179baa83 afl++ build crashes for some obscure reason. Tweaking the code like so gets it to squeak by and continue the build. Change-Id: I8cf477320eab19913c1bb65d9ccb779d9c37c8aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111491 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--external/libnumbertext/Afl++ICE.patch130
-rw-r--r--external/libnumbertext/UnpackedTarball_libnumbertext.mk1
2 files changed, 31 insertions, 0 deletions
diff --git a/external/libnumbertext/Afl++ICE.patch1 b/external/libnumbertext/Afl++ICE.patch1
new file mode 100644
index 000000000000..62104200632d
--- /dev/null
+++ b/external/libnumbertext/Afl++ICE.patch1
@@ -0,0 +1,30 @@
+--- /src/Soros.cxx 2021-02-24 15:31:59.003956770 +0000
++++ /src/Soros.cxx 2021-02-24 15:32:29.156601577 +0000
+@@ -45,6 +45,9 @@
+ begins(0),
+ ends(0)
+ {
++ const std::wstring_view numbertext = L"__numbertext__";
++ const std::wstring_view semicolon = L";";
++
+ program = translate(program, m, c, L"\\"); // \\, \", \;, \# -> \uE000..\uE003
+ // switch off all country-dependent lines, and switch on the requested ones
+ program = regex_replace(program, wregex(L"(^|[\n;])([^\n;#]*#[^\n]*\\[:[^\n:\\]]*:\\][^\n]*)"), L"$1#$2");
+@@ -52,7 +55,7 @@
+ program = regex_replace(program, wregex(L"(^|[\n;])#([^\n;#]*#[^\n]*\\[:" + filtered_lang + L":\\][^\n]*)"), L"$1$2");
+ program = regex_replace(program, wregex(L"(#[^\n]*)?(\n|$)"), L";"); // remove comments
+ // __numbertext__ sets the place of left zero deletion rule
+- if (program.find(L"__numbertext__") == std::wstring::npos)
++ if (program.find(numbertext) == std::wstring::npos)
+ program.insert(0, L"__numbertext__;");
+ program = regex_replace(program, wregex(L"__numbertext__"),
+ // default left zero deletion
+@@ -69,7 +72,7 @@
+ wregex quoteStart(L"^\"");
+ wregex quoteEnd(L"\"$");
+ std::wstring smacro;
+- while ((pos = program.find(L";", pos)) != std::wstring::npos) {
++ while ((pos = program.find(semicolon, pos)) != std::wstring::npos) {
+ wsmatch sp;
+ std::wstring linOrig = program.substr(old_pos, pos - old_pos);
+ // pattern extension after == macro ==:
diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
index 48cd2a9a273d..1238290049d1 100644
--- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk
+++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libnumbertext,1))
$(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \
external/libnumbertext/MSVCNonBMPBug.patch1 \
external/libnumbertext/WinUnicodePath.patch1 \
+ external/libnumbertext/Afl++ICE.patch1 \
))
# vim: set noet sw=4 ts=4: