CheckOther: Removed old zero division check
This commit is contained in:
parent
7ff7bc1c2e
commit
add84187cc
|
@ -2173,11 +2173,7 @@ void CheckOther::strPlusCharError(const Token *tok)
|
||||||
void CheckOther::checkZeroDivision()
|
void CheckOther::checkZeroDivision()
|
||||||
{
|
{
|
||||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "[/%] %num%") &&
|
if (Token::Match(tok, "div|ldiv|lldiv|imaxdiv ( %num% , %num% )") &&
|
||||||
MathLib::isInt(tok->next()->str()) &&
|
|
||||||
MathLib::toLongNumber(tok->next()->str()) == 0L) {
|
|
||||||
zerodivError(tok);
|
|
||||||
} else if (Token::Match(tok, "div|ldiv|lldiv|imaxdiv ( %num% , %num% )") &&
|
|
||||||
MathLib::isInt(tok->strAt(4)) &&
|
MathLib::isInt(tok->strAt(4)) &&
|
||||||
MathLib::toLongNumber(tok->strAt(4)) == 0L) {
|
MathLib::toLongNumber(tok->strAt(4)) == 0L) {
|
||||||
if (tok->str() == "div") {
|
if (tok->str() == "div") {
|
||||||
|
|
Loading…
Reference in New Issue