================
@@ -1297,6 +1297,11 @@ class AnnotatingParser {
next();
return true;
}
+ // Avoid consuming an unbalanced `}` here: it would pop a Scopes frame
+ // owned by an enclosing parseBrace and trip its `!Scopes.empty()`
+ // assertion. See Issue #199017.
+ if (CurrentToken->is(tok::r_brace))
----------------
mygitljf wrote:
You’re right, this is definitely the better approach.
I moved the fix to where the assert actually fires . Now no matter what path
drains the Scopes stack, parseBrace will just bail out gracefully instead of
crashing.
https://github.com/llvm/llvm-project/pull/199098
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits