Improve internal error print out, print line number with the error message.

This commit is contained in:
Reijo Tomperi 2011-11-03 22:43:13 +02:00
parent 9b8ffe7219
commit 682aae3196
1 changed files with 4 additions and 0 deletions

View File

@ -455,6 +455,10 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
} else { // %varid% } else { // %varid%
if (varid == 0) { if (varid == 0) {
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList; std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = tok->linenr();
loc.setfile("");
locationList.push_back(loc);
const ErrorLogger::ErrorMessage errmsg(locationList, const ErrorLogger::ErrorMessage errmsg(locationList,
Severity::error, Severity::error,
"Internal error. Token::Match called with varid 0.", "Internal error. Token::Match called with varid 0.",