mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-07 20:04:03 +00:00
llvm-undname: Fix an assert-on-invalid, found by oss-fuzz
If a template parameter refers to a pointer to member, but the mangling of that was a string literal instead of a real symbol, llvm-undname used to crash instead of rejecting the input. llvm-svn: 361402
This commit is contained in:
parent
3dbd723c6c
commit
e27cbb5c28
@ -2175,8 +2175,10 @@ Demangler::demangleTemplateParameterList(StringView &MangledName) {
|
||||
SymbolNode *S = nullptr;
|
||||
if (MangledName.startsWith('?')) {
|
||||
S = parse(MangledName);
|
||||
if (Error)
|
||||
if (Error || !S->Name) {
|
||||
Error = true;
|
||||
return nullptr;
|
||||
}
|
||||
memorizeIdentifier(S->Name->getUnqualifiedIdentifier());
|
||||
}
|
||||
|
||||
|
@ -169,3 +169,8 @@
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ??_C@_12@?z
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ??$foo@$1??_C@_02PCEFGMJL@hi?$AA@@
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
Loading…
Reference in New Issue
Block a user