[all-commits] [llvm/llvm-project] 2e16df: [ASTStructuralEquivalence] Fix crash when ObjCCate...

Volodymyr Sapsai via All-commits all-commits at lists.llvm.org
Fri Jun 9 17:10:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e16df352c7acb910313c80ac90b650ad9c14a3d
      https://github.com/llvm/llvm-project/commit/2e16df352c7acb910313c80ac90b650ad9c14a3d
  Author: Volodymyr Sapsai <vsapsai at apple.com>
  Date:   2023-06-09 (Fri, 09 Jun 2023)

  Changed paths:
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/unittests/AST/StructuralEquivalenceTest.cpp

  Log Message:
  -----------
  [ASTStructuralEquivalence] Fix crash when ObjCCategoryDecl doesn't have corresponding ObjCInterfaceDecl.

When this happens, it is invalid code and there is diagnostic
```
error: cannot find interface declaration for '...'
```

But clang shouldn't crash even if code is invalid. Though subsequent
diagnostic can be imperfect because without ObjCInterfaceDecl we don't have
a type for error messages.

rdar://108818430

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




More information about the All-commits mailing list