[llvm] r358891 - llvm-undname: Fix an assert-on-invalid, found by oss-fuzz
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 22 08:05:19 PDT 2019
Author: nico
Date: Mon Apr 22 08:05:18 2019
New Revision: 358891
URL: http://llvm.org/viewvc/llvm-project?rev=358891&view=rev
Log:
llvm-undname: Fix an assert-on-invalid, found by oss-fuzz
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=358891&r1=358890&r2=358891&view=diff
==============================================================================
--- llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp (original)
+++ llvm/trunk/lib/Demangle/MicrosoftDemangle.cpp Mon Apr 22 08:05:18 2019
@@ -1040,7 +1040,7 @@ wchar_t Demangler::demangleWcharLiteral(
uint8_t C1, C2;
C1 = demangleCharLiteral(MangledName);
- if (Error)
+ if (Error || MangledName.empty())
goto WCharLiteralError;
C2 = demangleCharLiteral(MangledName);
if (Error)
Modified: llvm/trunk/test/Demangle/invalid-manglings.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Demangle/invalid-manglings.test?rev=358891&r1=358890&r2=358891&view=diff
==============================================================================
--- llvm/trunk/test/Demangle/invalid-manglings.test (original)
+++ llvm/trunk/test/Demangle/invalid-manglings.test Mon Apr 22 08:05:18 2019
@@ -164,3 +164,8 @@
; CHECK-EMPTY:
; CHECK-NEXT: ??_C at _0601234567@abcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyzABCDEFGHIJKLMNOPQRTSUVWXYZabcdefghijklmnopqrtsuvwxyz
; CHECK-NEXT: error: Invalid mangled name
+
+??_C at _12@?z
+; CHECK-EMPTY:
+; CHECK-NEXT: ??_C at _12@?z
+; CHECK-NEXT: error: Invalid mangled name
More information about the llvm-commits
mailing list