From: Tim Northover Date: Thu, 15 Oct 2015 16:18:27 +0000 (+0000) Subject: Prevent assertion with "llc -debug" and anonymous symbols. X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=55975672e833f3cf15938eb70168d0a3fe62d8be Prevent assertion with "llc -debug" and anonymous symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250425 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCExpr.cpp b/lib/MC/MCExpr.cpp index 916e505c4b9..9d01e13e0a2 100644 --- a/lib/MC/MCExpr.cpp +++ b/lib/MC/MCExpr.cpp @@ -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);