MC: fix possible NULL pointer dereference

Avoid NULL pointer scenario found via clang's static analyzer.

llvm-svn: 203745
This commit is contained in:
Saleem Abdulrasool 2014-03-13 02:09:51 +00:00
parent ac1b1d7bfc
commit ac58e9fc0b

View File

@ -2005,7 +2005,7 @@ bool AsmParser::parseMacroArguments(const MCAsmMacro *M,
if (FAI >= NParameters) {
Error(IDLoc,
"parameter named '" + FA.Name + "' does not exist for macro '" +
M->Name + "'");
(M ? M->Name : "<unamed>") + "'");
return true;
}
PI = FAI;