mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 06:00:30 +00:00
MCSymbol: Make print() robust against empty names
This shouldn't happen, but it's nice not to abort when printing broken machine functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e498b5094c
commit
299e50237a
@ -50,6 +50,10 @@ void MCSymbol::print(raw_ostream &OS) const {
|
||||
// some targets support quoting names with funny characters. If the name
|
||||
// contains a funny character, then print it quoted.
|
||||
StringRef Name = getName();
|
||||
if (Name.empty()) {
|
||||
OS << "\"\"";
|
||||
return;
|
||||
}
|
||||
if (!NameNeedsQuoting(Name)) {
|
||||
OS << Name;
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user