#7190 Cppcheck hangs with 100% CPU load in Tokenizer::simplifyAttribute (invalidcode). Call validate() once more in Tokenizer::simplifyTokenList1 to trigger invalid code exception
This commit is contained in:
parent
308fd1ba50
commit
6ae1533cb4
|
@ -3502,6 +3502,9 @@ bool Tokenizer::simplifyTokenList1(const char FileName[])
|
||||||
// class Fred FINAL : Base { };
|
// class Fred FINAL : Base { };
|
||||||
removeMacroInClassDef();
|
removeMacroInClassDef();
|
||||||
|
|
||||||
|
// That call here fixes #7190
|
||||||
|
validate();
|
||||||
|
|
||||||
// remove __attribute__((?))
|
// remove __attribute__((?))
|
||||||
simplifyAttribute();
|
simplifyAttribute();
|
||||||
|
|
||||||
|
|
|
@ -208,6 +208,7 @@ private:
|
||||||
TEST_CASE(garbageCode157); // #7131
|
TEST_CASE(garbageCode157); // #7131
|
||||||
TEST_CASE(garbageCode158); // #3238
|
TEST_CASE(garbageCode158); // #3238
|
||||||
TEST_CASE(garbageCode159); // #7119
|
TEST_CASE(garbageCode159); // #7119
|
||||||
|
TEST_CASE(garbageCode160); // #7190
|
||||||
|
|
||||||
TEST_CASE(garbageValueFlow);
|
TEST_CASE(garbageValueFlow);
|
||||||
TEST_CASE(garbageSymbolDatabase);
|
TEST_CASE(garbageSymbolDatabase);
|
||||||
|
@ -1248,7 +1249,11 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbageCode159() { // #7119
|
void garbageCode159() { // #7119
|
||||||
checkCode("({}typedef typename x;typename x!){({{}()})}"); // dont hang
|
checkCode("({}typedef typename x;typename x!){({{}()})}"); // don't hang
|
||||||
|
}
|
||||||
|
|
||||||
|
void garbageCode160() { // #7190
|
||||||
|
ASSERT_THROW(checkCode("f(a,b,c,d)float [ a[],d;int ] b[],c;{} "), InternalError); // don't hang
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue