prevent uncaught exception in ThreadExecutor::handleRead() (#3514)

This commit is contained in:
Oliver Stöneberg 2021-10-20 20:41:42 +02:00 committed by GitHub
parent 921f5c1818
commit ba777b54d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View File

@ -121,7 +121,12 @@ int ThreadExecutor::handleRead(int rpipe, unsigned int &result)
mErrorLogger.reportOut(buf);
} else if (type == REPORT_ERROR || type == REPORT_INFO) {
ErrorMessage msg;
msg.deserialize(buf);
try {
msg.deserialize(buf);
} catch (const InternalError& e) {
std::cerr << "#### ThreadExecutor::handleRead error, internal error:" << e.errorMessage << std::endl;
std::exit(EXIT_FAILURE);
}
if (!mSettings.nomsg.isSuppressed(msg.toSuppressionsErrorMessage())) {
// Alert only about unique errors

View File

@ -1803,7 +1803,7 @@ void CheckCondition::checkCompareValueOutOfTypeRange()
break;
default:
break;
};
}
if (bits == 0 || bits >= 64)
continue;

View File

@ -998,7 +998,7 @@ void SymbolDatabase::createSymbolDatabaseVariableSymbolTable()
void SymbolDatabase::createSymbolDatabaseSetScopePointers()
{
auto setScopePointers = [this](const Scope &scope, const Token *bodyStart, const Token *bodyEnd) {
auto setScopePointers = [](const Scope &scope, const Token *bodyStart, const Token *bodyEnd) {
assert(bodyStart);
assert(bodyEnd);