[PATCH] D156277: [Parser][ObjC] Fix parser crash on nested top-level block with better recovery path

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 2 12:02:26 PDT 2023


rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.

LGTM.  Small wording suggestion for the comment, but feel free to commit with that change.



================
Comment at: clang/lib/Parse/ParseObjc.cpp:742
 
-    // Eat the identifier.
+    // Bail out as if we saw an '@end'
+    if (isTopLevelObjCKeyword(DirectiveKind))
----------------
"If we see something like '@interface' that's only allowed at the top level,
bail out as if we saw an '@end'.  We'll diagnose this below."


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156277/new/

https://reviews.llvm.org/D156277



More information about the cfe-commits mailing list