diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-17 17:13:57 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2014-03-17 17:13:57 +0000 |
commit | 1e4d7d7ef77b7961e3d3ade1258c2039711c00ad (patch) | |
tree | d29a171778376b01031fe0fa80e423767d41e27a /lib/MC/MCParser | |
parent | 5b5e5abd20e27217bf151c8bbf1da102e1a5c969 (diff) | |
download | llvm-1e4d7d7ef77b7961e3d3ade1258c2039711c00ad.tar.gz llvm-1e4d7d7ef77b7961e3d3ade1258c2039711c00ad.tar.bz2 llvm-1e4d7d7ef77b7961e3d3ade1258c2039711c00ad.tar.xz |
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
Diffstat (limited to 'lib/MC/MCParser')
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index fbbd4365bc..665e3d33d8 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 : "<unnamed>") + "'"); + M->Name + "'"); return true; } PI = FAI; |