Fixed crash on garbage code #7033

This commit is contained in:
PKEuS 2015-10-09 13:06:52 +02:00
parent 70dce7701a
commit 7d624f2e21
2 changed files with 6 additions and 0 deletions

View File

@ -459,6 +459,7 @@ void CheckBool::pointerArithBoolCond(const Token *tok)
return;
if (tok->astOperand1() &&
tok->astOperand2() &&
tok->astOperand1()->isName() &&
tok->astOperand1()->variable() &&
tok->astOperand1()->variable()->isPointer() &&

View File

@ -185,6 +185,7 @@ private:
TEST_CASE(garbageCode133);
TEST_CASE(garbageCode134);
TEST_CASE(garbageCode135); // #4994
TEST_CASE(garbageCode136); // #7033
TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase);
@ -1073,6 +1074,10 @@ private:
"long b = 2 ;");
}
void garbageCode136() { // #7033
checkCode("{ } () { void f() { node_t * n; for (; -n) {} } } { }");
}
void garbageValueFlow() {
// #6089