#7324 segmentation fault (invalid code) in Tokenizer::simplifyTokenList1
This commit is contained in:
parent
c672210e06
commit
36a6599386
|
@ -3025,7 +3025,7 @@ void Tokenizer::setVarId()
|
|||
vartok->varId(varpos->second);
|
||||
if (vartok->strAt(1) == "<") {
|
||||
tok3 = vartok->next()->findClosingBracket();
|
||||
if (tok3 && tok3->next()->link())
|
||||
if (tok3 && tok3->next() && tok3->next()->link())
|
||||
tok3 = tok3->next()->link();
|
||||
} else
|
||||
tok3 = vartok->linkAt(1);
|
||||
|
|
|
@ -212,6 +212,7 @@ private:
|
|||
TEST_CASE(garbageCode161); // #7200
|
||||
TEST_CASE(garbageCode162); // #7208
|
||||
TEST_CASE(garbageCode163); // #7228
|
||||
TEST_CASE(garbageCode164); // #7234
|
||||
TEST_CASE(garbageValueFlow);
|
||||
TEST_CASE(garbageSymbolDatabase);
|
||||
TEST_CASE(garbageAST);
|
||||
|
@ -1399,6 +1400,11 @@ private:
|
|||
ASSERT_THROW(checkCode("typedef s f[](){typedef d h(;f)}", false), InternalError);
|
||||
}
|
||||
|
||||
void garbageCode164() {
|
||||
//7234
|
||||
ASSERT_THROW(checkCode("class d{k p;}(){d::d():B<()}", false), InternalError);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestGarbage)
|
||||
|
|
Loading…
Reference in New Issue