Tokenizer::simplifyVarDecl: Fixed crash when checking garbage code.
This commit is contained in:
parent
0dccd3a632
commit
5a5277f2fa
|
@ -5465,8 +5465,8 @@ void Tokenizer::simplifyVarDecl(Token * tokBegin, Token * tokEnd, bool only_k_r_
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
tok2 = tok2->next();
|
||||
if (tok2)
|
||||
tok2 = tok2->next();
|
||||
}
|
||||
}
|
||||
finishedwithkr = (only_k_r_fpar && tok2 && tok2->strAt(1) == "{");
|
||||
|
|
|
@ -996,7 +996,8 @@ private:
|
|||
}
|
||||
|
||||
void garbageCode7() {
|
||||
tokenizeAndStringify(" 1 (int j) { return return (c) * sizeof } y[1];", /*simplify=*/true);
|
||||
tokenizeAndStringify("1 (int j) { return return (c) * sizeof } y[1];", /*simplify=*/true);
|
||||
tokenizeAndStringify("foo(Args&&...) fn void = { } auto template<typename... bar(Args&&...)", /*simplify=*/true);
|
||||
}
|
||||
|
||||
void simplifyFileAndLineMacro() { // tokenize 'return - __LINE__' correctly
|
||||
|
|
Loading…
Reference in New Issue