Verify: Fix false negative in itc
This commit is contained in:
parent
2c1905cc2b
commit
c56a45840a
|
@ -23,6 +23,7 @@
|
||||||
#include "tokenize.h"
|
#include "tokenize.h"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -1443,7 +1444,7 @@ void ExprEngine::executeFunction(const Scope *functionScope, const Tokenizer *to
|
||||||
void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, const Settings *settings)
|
void ExprEngine::runChecks(ErrorLogger *errorLogger, const Tokenizer *tokenizer, const Settings *settings)
|
||||||
{
|
{
|
||||||
std::function<void(const Token *, const ExprEngine::Value &, ExprEngine::DataBase *)> divByZero = [=](const Token *tok, const ExprEngine::Value &value, ExprEngine::DataBase *dataBase) {
|
std::function<void(const Token *, const ExprEngine::Value &, ExprEngine::DataBase *)> divByZero = [=](const Token *tok, const ExprEngine::Value &value, ExprEngine::DataBase *dataBase) {
|
||||||
if (!Token::Match(tok->astParent(), "[/%]"))
|
if (!tok->astParent() || !std::strchr("/%", tok->astParent()->str()[0]))
|
||||||
return;
|
return;
|
||||||
if (tok->astParent()->astOperand2() == tok && value.isEqual(dataBase, 0)) {
|
if (tok->astParent()->astOperand2() == tok && value.isEqual(dataBase, 0)) {
|
||||||
std::list<const Token*> callstack{tok->astParent()};
|
std::list<const Token*> callstack{tok->astParent()};
|
||||||
|
|
Loading…
Reference in New Issue