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

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 12:00:37 PDT 2016


bruno added a comment.

Ping!

In https://reviews.llvm.org/D23852#529308, @aaron.ballman wrote:

> 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.


Likewise, I'm not sure what's the best tradeoff. And there's probably more to come: some part of PR23057 is likely the need to properly handle EOFs.


https://reviews.llvm.org/D23852





More information about the cfe-commits mailing list