Fixed #2932 (segmentation fault of cppcheck ( i / i ))
This commit is contained in:
parent
fc0f75fe6a
commit
539c2e5acb
|
@ -1094,17 +1094,6 @@ void CheckOther::checkUnsignedDivision()
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (Token::Match(tok, "|[|=|return|%op% %var% / %var%"))
|
||||
{
|
||||
|
||||
//std::cout << "cicicicic" << std::endl;
|
||||
char sign1 = varsign[tok->tokAt(1)->varId()];
|
||||
char sign2 = varsign[tok->tokAt(3)->varId()];
|
||||
if ((sign1 == 'u' && sign2 == 's') || (sign1 == 's' && sign2 == 'u'))
|
||||
{
|
||||
//udivError(tok);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ private:
|
|||
TEST_CASE(division7);
|
||||
TEST_CASE(division8);
|
||||
TEST_CASE(division9);
|
||||
TEST_CASE(division10);
|
||||
}
|
||||
|
||||
void division1()
|
||||
|
@ -198,6 +199,13 @@ private:
|
|||
TODO_ASSERT_EQUALS("unsigned division",
|
||||
"", errout.str());
|
||||
}
|
||||
|
||||
void division10()
|
||||
{
|
||||
// Ticket: #2932 - don't segfault
|
||||
check("i / i");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestDivision)
|
||||
|
|
Loading…
Reference in New Issue