llvm.org GIT mirror llvm / 65c0092
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358237 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
2 changed file(s) with 8 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
480480 if (MangledName.consumeFront("__"))
481481 return demangleFunctionIdentifierCode(
482482 MangledName, FunctionIdentifierCodeGroup::DoubleUnder);
483 else if (MangledName.consumeFront("_"))
483 if (MangledName.consumeFront("_"))
484484 return demangleFunctionIdentifierCode(MangledName,
485485 FunctionIdentifierCodeGroup::Under);
486486 return demangleFunctionIdentifierCode(MangledName,
15741574 FuncClass VFlag = FC_VirtualThisAdjust;
15751575 if (MangledName.consumeFront('R'))
15761576 VFlag = FuncClass(VFlag | FC_VirtualThisAdjustEx);
1577
1577 if (MangledName.empty())
1578 break;
15781579 switch (MangledName.popFront()) {
15791580 case '0':
15801581 return FuncClass(FC_Private | FC_Virtual | VFlag);
9898 ; CHECK-EMPTY:
9999 ; CHECK-NEXT: ?B@?$?K$H?
100100 ; CHECK-NEXT: error: Invalid mangled name
101
102 ??C@$
103 ; CHECK-EMPTY:
104 ; CHECK-NEXT: ??C@$
105 ; CHECK-NEXT: error: Invalid mangled name