diff --git a/lib/exprengine.cpp b/lib/exprengine.cpp index aa43c01d9..947b87b7a 100644 --- a/lib/exprengine.cpp +++ b/lib/exprengine.cpp @@ -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 callstack{tok->astParent()}; + std::list 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);