diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2019-04-11 22:47:18 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2019-04-11 22:47:18 +0000 |
| commit | b4f33bbbb00a3e47e14081a9be352eb6a9b917b5 (patch) | |
| tree | 4a2991c9c9e155f4ae1577daaf874d5eed4d2e0e /llvm/lib | |
| parent | 8ec304c9fd92442393fcdd98f08fa07ac3ccf5df (diff) | |
| download | bcm5719-llvm-b4f33bbbb00a3e47e14081a9be352eb6a9b917b5.tar.gz bcm5719-llvm-b4f33bbbb00a3e47e14081a9be352eb6a9b917b5.zip | |
llvm-undname: Fix crash on incomplete virtual this adjusts
Found by oss-fuzz.
Also remove an else-after-return, this part has no behavior change.
llvm-svn: 358237
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Demangle/MicrosoftDemangle.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp index 194a152acb8..f45df9413d7 100644 --- a/llvm/lib/Demangle/MicrosoftDemangle.cpp +++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp @@ -481,7 +481,7 @@ Demangler::demangleFunctionIdentifierCode(StringView &MangledName) { if (MangledName.consumeFront("__")) return demangleFunctionIdentifierCode( MangledName, FunctionIdentifierCodeGroup::DoubleUnder); - else if (MangledName.consumeFront("_")) + if (MangledName.consumeFront("_")) return demangleFunctionIdentifierCode(MangledName, FunctionIdentifierCodeGroup::Under); return demangleFunctionIdentifierCode(MangledName, @@ -1575,7 +1575,8 @@ FuncClass Demangler::demangleFunctionClass(StringView &MangledName) { FuncClass VFlag = FC_VirtualThisAdjust; if (MangledName.consumeFront('R')) VFlag = FuncClass(VFlag | FC_VirtualThisAdjustEx); - + if (MangledName.empty()) + break; switch (MangledName.popFront()) { case '0': return FuncClass(FC_Private | FC_Virtual | VFlag); |

