This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3cb16f6d2ddd: [Sema][ObjC] Invalidate BlockDecl with invalid ParmVarDecl (authored by dingfei <fd...@feysh.com>).
Changed prior to commit: https://reviews.llvm.org/D155984?vs=543005&id=543451#toc Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D155984/new/ https://reviews.llvm.org/D155984 Files: clang/docs/ReleaseNotes.rst clang/lib/Sema/SemaExpr.cpp clang/test/AST/ast-dump-recovery.m Index: clang/test/AST/ast-dump-recovery.m =================================================================== --- clang/test/AST/ast-dump-recovery.m +++ clang/test/AST/ast-dump-recovery.m @@ -24,3 +24,9 @@ int (^gh63863)() = ^() { return undef; }; + +// CHECK: `-BlockExpr {{.*}} 'int (^)(int, int)' +// CHECK-NEXT: `-BlockDecl {{.*}} invalid +int (^gh64005)(int, int) = ^(int, undefined b) { + return 1; +}; Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -16959,6 +16959,9 @@ PushOnScopeChains(AI, CurBlock->TheScope); } + + if (AI->isInvalidDecl()) + CurBlock->TheDecl->setInvalidDecl(); } } Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -674,6 +674,8 @@ value exprs is invalid. Propagating the error info up by replacing BlockExpr with a RecoveryExpr. This fixes: (`#63863 <https://github.com/llvm/llvm-project/issues/63863>_`) +- Invalidate BlockDecl with invalid ParmVarDecl + (`#64005 <https://github.com/llvm/llvm-project/issues/64005>_`) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Index: clang/test/AST/ast-dump-recovery.m =================================================================== --- clang/test/AST/ast-dump-recovery.m +++ clang/test/AST/ast-dump-recovery.m @@ -24,3 +24,9 @@ int (^gh63863)() = ^() { return undef; }; + +// CHECK: `-BlockExpr {{.*}} 'int (^)(int, int)' +// CHECK-NEXT: `-BlockDecl {{.*}} invalid +int (^gh64005)(int, int) = ^(int, undefined b) { + return 1; +}; Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -16959,6 +16959,9 @@ PushOnScopeChains(AI, CurBlock->TheScope); } + + if (AI->isInvalidDecl()) + CurBlock->TheDecl->setInvalidDecl(); } } Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -674,6 +674,8 @@ value exprs is invalid. Propagating the error info up by replacing BlockExpr with a RecoveryExpr. This fixes: (`#63863 <https://github.com/llvm/llvm-project/issues/63863>_`) +- Invalidate BlockDecl with invalid ParmVarDecl + (`#64005 <https://github.com/llvm/llvm-project/issues/64005>_`) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits