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, fixes issues 12428 and 12429 on oss-fuzz. Differential Revision: https://reviews.llvm.org/D60204 llvm-svn: 357647
This commit is contained in:
parent
d503567673
commit
b6b1db8acb
@ -466,6 +466,10 @@ IdentifierNode *
|
||||
Demangler::demangleFunctionIdentifierCode(StringView &MangledName) {
|
||||
assert(MangledName.startsWith('?'));
|
||||
MangledName = MangledName.dropFront();
|
||||
if (MangledName.empty()) {
|
||||
Error = true;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (MangledName.consumeFront("__"))
|
||||
return demangleFunctionIdentifierCode(
|
||||
@ -637,6 +641,7 @@ translateIntrinsicFunctionCode(char CH, FunctionIdentifierCodeGroup Group) {
|
||||
IdentifierNode *
|
||||
Demangler::demangleFunctionIdentifierCode(StringView &MangledName,
|
||||
FunctionIdentifierCodeGroup Group) {
|
||||
assert(!MangledName.empty());
|
||||
switch (Group) {
|
||||
case FunctionIdentifierCodeGroup::Basic:
|
||||
switch (char CH = MangledName.popFront()) {
|
||||
|
@ -14,3 +14,8 @@
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ?@@8
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
||||
??
|
||||
; CHECK-EMPTY:
|
||||
; CHECK-NEXT: ??
|
||||
; CHECK-NEXT: error: Invalid mangled name
|
||||
|
Loading…
Reference in New Issue
Block a user