CheckBufferOverrun: fix FP for array definition of static class member
This commit is contained in:
parent
67e8b99c2c
commit
81a1d744c6
|
@ -188,7 +188,7 @@ void CheckBufferOverrun::arrayIndex()
|
||||||
const Token *parent = tok;
|
const Token *parent = tok;
|
||||||
while (parent && !Token::simpleMatch(parent->astParent(), "="))
|
while (parent && !Token::simpleMatch(parent->astParent(), "="))
|
||||||
parent = parent->astParent();
|
parent = parent->astParent();
|
||||||
if (parent && parent == parent->astParent()->astOperand1())
|
if (!parent || parent == parent->astParent()->astOperand1())
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2138,11 +2138,15 @@ private:
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("class X { static const int x[100]; };\n" // #6070
|
check("class X { static const int x[100]; };\n" // #6070
|
||||||
"const int X::x[100] = {0};", false, "test.cpp");
|
"const int X::x[100] = {0};");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("namespace { class X { static const int x[100]; };\n" // #6232
|
check("namespace { class X { static const int x[100]; };\n" // #6232
|
||||||
"const int X::x[100] = {0}; }", false, "test.cpp");
|
"const int X::x[100] = {0}; }");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("class ActorSprite { static ImageSet * targetCursorImages[2][10]; };\n"
|
||||||
|
"ImageSet *ActorSprite::targetCursorImages[2][10];\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue