diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 61719f5291d..3046bea69cc 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -8962,6 +8962,8 @@ void Tokenizer::findGarbageCode() const const Token* const endTok = tok->linkAt(1); for (tok = tok->tokAt(2); tok != endTok; tok = tok->next()) { if (const Token* lam = findLambdaEndTokenWithoutAST(tok)) { + if (lam == endTok) + break; tok = lam; continue; } diff --git a/test/cli/fuzz-crash/crash-17be2b85446aeb0c7722bedfad4b0e4af27fae3d b/test/cli/fuzz-crash/crash-17be2b85446aeb0c7722bedfad4b0e4af27fae3d new file mode 100644 index 00000000000..0f06807b7ba --- /dev/null +++ b/test/cli/fuzz-crash/crash-17be2b85446aeb0c7722bedfad4b0e4af27fae3d @@ -0,0 +1 @@ +{for([]{});}