summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-05-22 15:53:23 +0000
committerNico Weber <nicolasweber@gmx.de>2019-05-22 15:53:23 +0000
commit09fb2029e5420e12a3f9c47d8c55b2d715df0e05 (patch)
tree27f6b68d3f0b8ebb17db454666d5ceb4b4d5f963 /llvm/lib/Demangle
parent5a4f7cf2ff3fc15d82ca062ee64dd8bd01a68883 (diff)
downloadbcm5719-llvm-09fb2029e5420e12a3f9c47d8c55b2d715df0e05.tar.gz
bcm5719-llvm-09fb2029e5420e12a3f9c47d8c55b2d715df0e05.zip
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
Diffstat (limited to 'llvm/lib/Demangle')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangle.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index 4942e0e3655..041d327596b 100644
--- a/llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -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());
}
OpenPOWER on IntegriCloud