llvm.org GIT mirror llvm / d05c59d
llvm-undname: Fix an assert-on-invalid Found by oss-fuzz, fixes issues 12428 and 12429 on oss-fuzz. Differential Revision: https://reviews.llvm.org/D60204 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357647 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
2 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
465465 Demangler::demangleFunctionIdentifierCode(StringView &MangledName) {
466466 assert(MangledName.startsWith('?'));
467467 MangledName = MangledName.dropFront();
468 if (MangledName.empty()) {
469 Error = true;
470 return nullptr;
471 }
468472
469473 if (MangledName.consumeFront("__"))
470474 return demangleFunctionIdentifierCode(
636640 IdentifierNode *
637641 Demangler::demangleFunctionIdentifierCode(StringView &MangledName,
638642 FunctionIdentifierCodeGroup Group) {
643 assert(!MangledName.empty());
639644 switch (Group) {
640645 case FunctionIdentifierCodeGroup::Basic:
641646 switch (char CH = MangledName.popFront()) {
1313 ; CHECK-EMPTY:
1414 ; CHECK-NEXT: ?@@8
1515 ; CHECK-NEXT: error: Invalid mangled name
16
17 ??
18 ; CHECK-EMPTY:
19 ; CHECK-NEXT: ??
20 ; CHECK-NEXT: error: Invalid mangled name