From 55975672e833f3cf15938eb70168d0a3fe62d8be Mon Sep 17 00:00:00 2001 From: Tim Northover Date: Thu, 15 Oct 2015 16:18:27 +0000 Subject: [PATCH] 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 --- lib/MC/MCExpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.34.1