#6751 segmentation fault (invalid code) in Tokenizer::simplifyTypedef.
This commit is contained in:
parent
ed5a4127e8
commit
87bf09c0ae
|
@ -1061,7 +1061,9 @@ void Tokenizer::simplifyTypedef()
|
|||
// check for operator typedef
|
||||
/** @todo add support for multi-token operators */
|
||||
else if (tok2->str() == "operator" &&
|
||||
tok2->next() &&
|
||||
tok2->next()->str() == typeName->str() &&
|
||||
tok2->linkAt(2) &&
|
||||
tok2->strAt(2) == "(" &&
|
||||
Token::Match(tok2->linkAt(2), ") const| {")) {
|
||||
// check for qualifier
|
||||
|
|
|
@ -112,6 +112,7 @@ private:
|
|||
TEST_CASE(garbageCode71);
|
||||
TEST_CASE(garbageCode72);
|
||||
TEST_CASE(garbageCode73);
|
||||
TEST_CASE(garbageCode74);
|
||||
|
||||
TEST_CASE(garbageValueFlow);
|
||||
TEST_CASE(garbageSymbolDatabase);
|
||||
|
@ -625,6 +626,10 @@ private:
|
|||
ASSERT_THROW(checkCode("typedef int IRT[2]; IRT&"), InternalError);
|
||||
}
|
||||
|
||||
void garbageCode74() { // #6751
|
||||
checkCode("_lenraw(const char* digits) { } typedef decltype(sizeof(0)) { } operator");
|
||||
}
|
||||
|
||||
void garbageValueFlow() {
|
||||
// #6089
|
||||
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
||||
|
|
Loading…
Reference in New Issue