Fixed crash on garbage code (#8317)
This commit is contained in:
parent
eb58df236e
commit
817f66d74d
|
@ -459,6 +459,8 @@ void CheckAutoVariables::returnReference()
|
|||
for (const Token *tok2 = scope->classStart->next(); tok2 && tok2 != scope->classEnd; tok2 = tok2->next()) {
|
||||
if (!tok2->scope()->isExecutable()) {
|
||||
tok2 = tok2->scope()->classEnd;
|
||||
if (!tok2)
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ private:
|
|||
TEST_CASE(garbageCode186); // #8151
|
||||
TEST_CASE(garbageCode187);
|
||||
TEST_CASE(garbageCode188);
|
||||
TEST_CASE(garbageCode189); // #8317
|
||||
TEST_CASE(garbageValueFlow);
|
||||
TEST_CASE(garbageSymbolDatabase);
|
||||
TEST_CASE(garbageAST);
|
||||
|
@ -1437,6 +1438,10 @@ private:
|
|||
ASSERT_THROW(checkCode("{z r(){(){for(;<(x);){if(0==0)}}}}"), InternalError);
|
||||
}
|
||||
|
||||
void garbageCode189() { // #8317
|
||||
checkCode("t&n(){()()[](){()}}$");
|
||||
}
|
||||
|
||||
void syntaxErrorFirstToken() {
|
||||
ASSERT_THROW(checkCode("&operator(){[]};"), InternalError); // #7818
|
||||
ASSERT_THROW(checkCode("*(*const<> (size_t); foo) { } *(*const (size_t)() ; foo) { }"), InternalError); // #6858
|
||||
|
|
Loading…
Reference in New Issue