Catch InternalError by reference instead of creating a copy of it.
This commit is contained in:
parent
2dd53ec966
commit
756b8762ab
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue