1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

llvm-undname: Don't crash on incomplete enum tag manglings

Found by inspection.

llvm-svn: 358238
This commit is contained in:
Nico Weber 2019-04-11 22:59:25 +00:00
parent f882334690
commit e97d558ce9
2 changed files with 6 additions and 1 deletions

View File

@ -1907,7 +1907,7 @@ TagTypeNode *Demangler::demangleClassType(StringView &MangledName) {
TT = Arena.alloc<TagTypeNode>(TagKind::Class); TT = Arena.alloc<TagTypeNode>(TagKind::Class);
break; break;
case 'W': case 'W':
if (MangledName.popFront() != '4') { if (!MangledName.consumeFront('4')) {
Error = true; Error = true;
return nullptr; return nullptr;
} }

View File

@ -104,3 +104,8 @@
; CHECK-EMPTY: ; CHECK-EMPTY:
; CHECK-NEXT: ??C@$ ; CHECK-NEXT: ??C@$
; CHECK-NEXT: error: Invalid mangled name ; CHECK-NEXT: error: Invalid mangled name
?x@@3PAW
; CHECK-EMPTY:
; CHECK-NEXT: ?x@@3PAW
; CHECK-NEXT: error: Invalid mangled name