From: Saleem Abdulrasool Date: Mon, 17 Mar 2014 17:13:57 +0000 (+0000) Subject: MC: change runtime check to an assertion X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1e4d7d7ef77b7961e3d3ade1258c2039711c00ad;p=oota-llvm.git MC: change runtime check to an assertion It is unclear how it would be possible to get M to be NULL in normal scenarios. Change this to an assert rather than a runtime check as per dblakie's suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204060 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index fbbd4365bcb..665e3d33d88 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -1998,9 +1998,10 @@ bool AsmParser::parseMacroArguments(const MCAsmMacro *M, break; if (FAI >= NParameters) { + assert(M && "expected macro to be defined"); Error(IDLoc, "parameter named '" + FA.Name + "' does not exist for macro '" + - (M ? M->Name : "") + "'"); + M->Name + "'"); return true; } PI = FAI;