[llvm] bf1e96d - [MicrosoftDemangle] Set error to true when returning nullptr.
Zequan Wu via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 8 17:18:16 PDT 2022
Author: Zequan Wu
Date: 2022-06-08T17:18:09-07:00
New Revision: bf1e96d6206e8f551680f5929e00afb09092deb1
URL: https://github.com/llvm/llvm-project/commit/bf1e96d6206e8f551680f5929e00afb09092deb1
DIFF: https://github.com/llvm/llvm-project/commit/bf1e96d6206e8f551680f5929e00afb09092deb1.diff
LOG: [MicrosoftDemangle] Set error to true when returning nullptr.
Added:
Modified:
llvm/lib/Demangle/MicrosoftDemangle.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index aca8cf7a0a58c..b4e98a20f389b 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);
}
More information about the llvm-commits
mailing list