llvm.org GIT mirror llvm / 12041c1
llvm-undname: Fix another crash-on-invalid This fixes a regression from https://reviews.llvm.org/D60354. We used to SymbolNode *Symbol = demangleEncodedSymbol(MangledName, QN); if (Symbol) { Symbol->Name = QN; } but changed that to SymbolNode *Symbol = demangleEncodedSymbol(MangledName, QN); if (Error) return nullptr; Symbol->Name = QN; and one branch somewhere returned a nullptr without setting Error. Looking at the code changed in r340083 and r340710 that branch looks like a remnant from an earlier attempt to demangle RTTI descriptors that has since been rewritten -- so just remove this branch. It shouldn't change behavior for correctly mangled symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358112 91177308-0d34-0410-b5e6-96231b3b80d8 Nico Weber 1 year, 7 months ago
2 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
695695 StorageClass SC = demangleVariableStorageClass(MangledName);
696696 return demangleVariableEncoding(MangledName, SC);
697697 }
698 case '8':
699 return nullptr;
700698 }
701699 FunctionSymbolNode *FSN = demangleFunctionEncoding(MangledName);
702700
8888 ; CHECK-EMPTY:
8989 ; CHECK-NEXT: ??__E?Foo@@0HA@@
9090 ; CHECK-NEXT: error: Invalid mangled name
91
92 ??8@8
93 ; CHECK-EMPTY:
94 ; CHECK-NEXT: ??8@8
95 ; CHECK-NEXT: error: Invalid mangled name