Bug 1856663 - Add more chunks for Android mochitest-plain. r=jmaher,taskgraph-reviewe...
[gecko.git] / build / build-clang / android-mangling-error_clang_12.patch
blob315756d30b90e2c6f434cc2624f8c20d96b2c18d
1 Workaround segfault in clang's mangling code that is tickled when
2 attempting to mangle the declaration:
3 std:__ndk1::__find_detail::__find_exactly_one_checked::__matches
4 in the <tuple> header in the Android NDK.
5 This codepath is exercised by MozsearchIndexer.cpp (the searchfox
6 indexer) when indexing on Android. See also
7 https://bugs.llvm.org/show_bug.cgi?id=40747
9 diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp
10 index 4420f6a2c1c3..39792e6b7350 100644
11 --- a/clang/lib/AST/ItaniumMangle.cpp
12 +++ b/clang/lib/AST/ItaniumMangle.cpp
13 @@ -3954,6 +3954,11 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity,
14 // produces no output, where ImplicitlyConvertedToType and AsTemplateArg need
15 // to be preserved.
16 recurse:
17 + if (!E) {
18 + Out << "MOZ_WE_HACKED_AROUND_BUG_1500941";
19 + return;
20 + }
22 switch (E->getStmtClass()) {
23 case Expr::NoStmtClass:
24 #define ABSTRACT_STMT(Type)