summaryrefslogtreecommitdiffstats
path: root/build/build-clang/android-mangling-error_clang_12.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /build/build-clang/android-mangling-error_clang_12.patch
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/build-clang/android-mangling-error_clang_12.patch')
-rw-r--r--build/build-clang/android-mangling-error_clang_12.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/build/build-clang/android-mangling-error_clang_12.patch b/build/build-clang/android-mangling-error_clang_12.patch
new file mode 100644
index 0000000000..315756d30b
--- /dev/null
+++ b/build/build-clang/android-mangling-error_clang_12.patch
@@ -0,0 +1,24 @@
+Workaround segfault in clang's mangling code that is tickled when
+attempting to mangle the declaration:
+ std:__ndk1::__find_detail::__find_exactly_one_checked::__matches
+in the <tuple> header in the Android NDK.
+This codepath is exercised by MozsearchIndexer.cpp (the searchfox
+indexer) when indexing on Android. See also
+https://bugs.llvm.org/show_bug.cgi?id=40747
+
+diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
+index 4420f6a2c1c3..39792e6b7350 100644
+--- a/clang/lib/AST/ItaniumMangle.cpp
++++ b/clang/lib/AST/ItaniumMangle.cpp
+@@ -3954,6 +3954,11 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity,
+ // produces no output, where ImplicitlyConvertedToType and AsTemplateArg need
+ // to be preserved.
+ recurse:
++ if (!E) {
++ Out << "MOZ_WE_HACKED_AROUND_BUG_1500941";
++ return;
++ }
++
+ switch (E->getStmtClass()) {
+ case Expr::NoStmtClass:
+ #define ABSTRACT_STMT(Type)