From bf1e96d6206e8f551680f5929e00afb09092deb1 Mon Sep 17 00:00:00 2001 From: Zequan Wu Date: Wed, 8 Jun 2022 17:08:22 -0700 Subject: [PATCH] [MicrosoftDemangle] Set error to true when returning nullptr. --- llvm/lib/Demangle/MicrosoftDemangle.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index aca8cf7a0a58..b4e98a20f389 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -823,11 +823,15 @@ SymbolNode *Demangler::parse(StringView &MangledName) { } TagTypeNode *Demangler::parseTagUniqueName(StringView &MangledName) { - if (!MangledName.consumeFront(".?A")) + if (!MangledName.consumeFront(".?A")) { + Error = true; return nullptr; + } MangledName.consumeFront(".?A"); - if (MangledName.empty()) + if (MangledName.empty()) { + Error = true; return nullptr; + } return demangleClassType(MangledName); }