[cfe-commits] [PATCH] Implementation quantity limits to prevent crashes

Aaron Ballman aaron at aaronballman.com
Mon Oct 10 19:47:53 PDT 2011

On Sun, Oct 9, 2011 at 12:35 PM, Douglas Gregor <dgregor at apple.com> wrote:
>>> I'd prefer that we keep the open/close source locations within BalancedDelimiterTracker, which would simplify the interface a bit, since *every* user of BalancedDelimiterTracker needs to track this information anyway.
>> I've implemented this change as well -- it was a good point, and it
>> does make things cleaner.  I had to update the signature for
>> ParseInnerNamespace though, since that was the one use case that
>> needed the opening brace to be passed in manually.
> I see that you're holding on to the opening source location (which is good), but it doesn't look like you've simplified the interface at all. Why bother to still pass in the "open" and "close" addresses in these functions:

I've completed these changes as discussed, and I think the code has
turned out to be better for them.  Thanks for the clarification
earlier today!

I did have to modify a few parser signatures to pass around a
BalancedDelimiterTracker, but it ended up simplifying the interfaces
in those cases as well.

Tested against ToT and it should apply cleanly, and it causes no
regressions in the test suite.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: ParserLimits4.diff
Type: application/octet-stream
Size: 118185 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111010/7f0723e4/attachment.obj>

More information about the cfe-commits mailing list