This fixes Bug 10332 where nested braces causes the parser to crash
with a stack overflow.  It also fixes the same issue with parens for
expressions.  It's a more generalized fix that can be applied for most
of the quantities listed in [implimits] should it be desired.

One thing which I'd like to direct special attention to is how I'm
"handling" the fatal error in Parser::ImplQuantityTracker::report.
I'm uncertain of what place to skip to due to the nature of the issue.
 At the point of failure, we've read a lot of { or ( and are "too
deep."  Skipping until we find a } doesn't seem like it would produce
a likely recovery point.  However, I'm more than happy to take
suggestions on improvements for it as skipping to EOF doesn't feel
quite right either.

Also, the diagnostic wording was taken from MSVC, but could likely be
improved.  Suggestions welcome.

The patch includes a test case from the bug report.

~Aaron

Attachment: ParserLimits.diff
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to