Bug hunting: Set 'inconclusive' flag for bailout values
This commit is contained in:
parent
3eb19a64cb
commit
5d67fd0e56
|
@ -1986,8 +1986,9 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer,
|
||||||
dataBase->addError(tok->linenr());
|
dataBase->addError(tok->linenr());
|
||||||
std::list<const Token*> callstack{settings->clang ? tok : tok->astParent()};
|
std::list<const Token*> callstack{settings->clang ? tok : tok->astParent()};
|
||||||
const char * const id = (tok->valueType() && tok->valueType()->isFloat()) ? "bughuntingDivByZeroFloat" : "bughuntingDivByZero";
|
const char * const id = (tok->valueType() && tok->valueType()->isFloat()) ? "bughuntingDivByZeroFloat" : "bughuntingDivByZero";
|
||||||
ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, id, "There is division, cannot determine that there can't be a division by zero.", CWE(369), false);
|
const bool bailout = (value.type == ExprEngine::ValueType::BailoutValue);
|
||||||
if (value.type != ExprEngine::ValueType::BailoutValue)
|
ErrorLogger::ErrorMessage errmsg(callstack, &tokenizer->list, Severity::SeverityType::error, id, "There is division, cannot determine that there can't be a division by zero.", CWE(369), bailout);
|
||||||
|
if (!bailout)
|
||||||
errmsg.function = dataBase->currentFunction;
|
errmsg.function = dataBase->currentFunction;
|
||||||
errorLogger->reportErr(errmsg);
|
errorLogger->reportErr(errmsg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue