Catch InternalError by reference instead of creating a copy of it.

This commit is contained in:
Reijo Tomperi 2012-01-09 18:30:36 +02:00
parent 2dd53ec966
commit 756b8762ab
2 changed files with 2 additions and 2 deletions

View File

@ -434,7 +434,7 @@ void CppCheck::checkFile(const std::string &code, const char FileName[])
}
}
#endif
} catch (InternalError e) {
} catch (const InternalError &e) {
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc2;
loc2.setfile(Path::toNativeSeparators(FileName));

View File

@ -7060,7 +7060,7 @@ bool Tokenizer::simplifyCalculations()
else {
try {
tok->str(MathLib::calculate(tok->str(), tok->strAt(2), tok->next()->str()[0]));
} catch (InternalError e) {
} catch (InternalError &e) {
e.token = tok;
throw e;
}