[llvm] r358238 - llvm-undname: Don't crash on incomplete enum tag manglings
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 11 15:59:25 PDT 2019
Author: nico
Date: Thu Apr 11 15:59:25 2019
New Revision: 358238
URL: http://llvm.org/viewvc/llvm-project?rev=358238&view=rev
Log:
llvm-undname: Don't crash on incomplete enum tag manglings
Found by inspection.
Modified:
llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
llvm/trunk/test/Demangle/invalid-manglings.test
Modified: llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp?rev=358238&r1=358237&r2=358238&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp Thu Apr 11 15:59:25 2019
@@ -1907,7 +1907,7 @@ TagTypeNode *Demangler::demangleClassTyp
TT = Arena.alloc<TagTypeNode>(TagKind::Class);
break;
case 'W':
- if (MangledName.popFront() != '4') {
+ if (!MangledName.consumeFront('4')) {
Error = true;
return nullptr;
}
Modified: llvm/trunk/test/Demangle/invalid-manglings.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Demangle/invalid-manglings.test?rev=358238&r1=358237&r2=358238&view=diff
==============================================================================
--- llvm/trunk/test/Demangle/invalid-manglings.test (original)
+++ llvm/trunk/test/Demangle/invalid-manglings.test Thu Apr 11 15:59:25 2019
@@ -104,3 +104,8 @@
; CHECK-EMPTY:
; CHECK-NEXT: ??C@$
; CHECK-NEXT: error: Invalid mangled name
+
+?x@@3PAW
+; CHECK-EMPTY:
+; CHECK-NEXT: ?x@@3PAW
+; CHECK-NEXT: error: Invalid mangled name
More information about the llvm-commits
mailing list