[PATCH] D23852: [SemaObjC] Fix crash while parsing type arguments and protocols

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 11:45:59 PDT 2016


aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a comment.

In https://reviews.llvm.org/D23852#525291, @doug.gregor wrote:

> This will work, but it's *really* unfortunate to put tentative parsing into this code path because tentative parsing is far from free, and specialized Objective-C types are getting pretty common in Objective-C headers. Why can't the callers be taught to handle EOF and bail out?


The unfortunate part of that is it makes all of the callers fragile -- we have to sprinkle "are we at EOF now" checks all over, or risk running into the same problem later. We don't typically do that (there are only 7 eof checks in the parser currently, this adds 6 more). I don't know which option is worse.


https://reviews.llvm.org/D23852





More information about the cfe-commits mailing list