[all-commits] [llvm/llvm-project] 1f3c1c: [Parser][ObjC] Fix crash on nested top-level block...

Ding Fei via All-commits all-commits at lists.llvm.org
Wed Aug 2 21:59:07 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f3c1cba49a1ace7d2813b3be69279df322c2db0
      https://github.com/llvm/llvm-project/commit/1f3c1cba49a1ace7d2813b3be69279df322c2db0
  Author: dingfei <fding at feysh.com>
  Date:   2023-08-03 (Thu, 03 Aug 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Parse/ParseObjc.cpp
    A clang/test/Parser/missing-end-1-gh64065-nocrash.m
    M clang/test/Parser/missing-end-2.m
    M clang/test/Parser/missing-end-3.m
    M clang/test/Parser/missing-end-4.m

  Log Message:
  -----------
  [Parser][ObjC] Fix crash on nested top-level block with better recovery path

Delay consuming tokens until we are certain that the next token is not top
level block. Otherwise we bail out as if we saw an @end for better diagnostic
and recovery.

Fixes https://github.com/llvm/llvm-project/issues/64065.

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D156277.




More information about the All-commits mailing list