Fixed testrunner
This commit is contained in:
parent
f9b132e831
commit
c483bcb12b
|
@ -8401,6 +8401,18 @@ static const Token *findUnmatchedTernaryOp(const Token * const begin, const Toke
|
||||||
|
|
||||||
void Tokenizer::findGarbageCode() const
|
void Tokenizer::findGarbageCode() const
|
||||||
{
|
{
|
||||||
|
// Inside [] there can't be ; or various keywords
|
||||||
|
for (const Token *tok = tokens(); tok; tok = tok->next()) {
|
||||||
|
if (tok->str() != "[")
|
||||||
|
continue;
|
||||||
|
for (const Token *inner = tok->next(); inner != tok->link(); inner = inner->next()) {
|
||||||
|
if (Token::Match(inner, "(|["))
|
||||||
|
inner = inner->link();
|
||||||
|
else if (Token::Match(inner, ";|goto|return|typedef"))
|
||||||
|
syntaxError(inner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (const Token *tok = tokens(); tok; tok = tok->next()) {
|
for (const Token *tok = tokens(); tok; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "if|while|for|switch")) { // if|while|for|switch (EXPR) { ... }
|
if (Token::Match(tok, "if|while|for|switch")) { // if|while|for|switch (EXPR) { ... }
|
||||||
if (tok->previous() && !Token::Match(tok->previous(), "%name%|:|;|{|}|(|)|,"))
|
if (tok->previous() && !Token::Match(tok->previous(), "%name%|:|;|{|}|(|)|,"))
|
||||||
|
|
|
@ -782,7 +782,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbageCode91() { // #6791
|
void garbageCode91() { // #6791
|
||||||
checkCode("typedef __attribute__((vector_size (16))) { return[ (v2df){ } ;] }"); // do not crash
|
ASSERT_THROW(checkCode("typedef __attribute__((vector_size (16))) { return[ (v2df){ } ;] }"), InternalError); // throw syntax error
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbageCode92() { // #6792
|
void garbageCode92() { // #6792
|
||||||
|
@ -799,7 +799,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbageCode96() { // #6807
|
void garbageCode96() { // #6807
|
||||||
ASSERT_THROW(checkCode("typedef J J[ ; typedef ( ) ( ) { ; } typedef J J ;] ( ) ( J cx ) { n } ;"), InternalError);
|
ASSERT_THROW(checkCode("typedef J J[ ; typedef ( ) ( ) { ; } typedef J J ;] ( ) ( J cx ) { n } ;"), InternalError); // throw syntax error
|
||||||
}
|
}
|
||||||
|
|
||||||
void garbageCode97() { // #6808
|
void garbageCode97() { // #6808
|
||||||
|
|
Loading…
Reference in New Issue