ExprEngine; In divbyzero report rhs token because that has better location
This commit is contained in:
parent
16981f0813
commit
a6ab986217
|
@ -1830,7 +1830,7 @@ void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer,
|
|||
}
|
||||
if (tok->astParent()->astOperand2() == tok && value.isEqual(dataBase, 0)) {
|
||||
dataBase->addError(tok->linenr());
|
||||
std::list<const Token*> callstack{tok->astParent()};
|
||||
std::list<const Token*> callstack{settings->clang ? tok : tok->astParent()};
|
||||
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);
|
||||
errorLogger->reportErr(errmsg);
|
||||
|
|
Loading…
Reference in New Issue