Prevent assertion with "llc -debug" and anonymous symbols.

llvm-svn: 250425
This commit is contained in:
Tim Northover 2015-10-15 16:18:27 +00:00
parent 33e17a7c73
commit 0515291c52
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ void MCExpr::print(raw_ostream &OS, const MCAsmInfo *MAI) const {
const MCSymbol &Sym = SRE.getSymbol();
// Parenthesize names that start with $ so that they don't look like
// absolute names.
bool UseParens = Sym.getName()[0] == '$';
bool UseParens = Sym.getName().size() && Sym.getName()[0] == '$';
if (UseParens) {
OS << '(';
Sym.print(OS, MAI);