[PATCH] D74417: [clang][ARC] Remove invalid assertion that can crash clangd

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 08:38:27 PST 2020


dgoldman created this revision.
dgoldman added reviewers: erik.pilkington, jkorous.
Herald added subscribers: cfe-commits, usaxena95, kadircet, arphaman, dexonsmith, MaskRay, ilya-biryukov.
Herald added a project: clang.

- This assertion will fire when functions are marked with `objc_externally_retained`, such as in the following function: `__attribute__((objc_externally_retained)) void AssertOnQueue(dispatch_queue_t queue)`

- Thus the assertion isn't valid as these parameters are indeed psuedo strong


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74417

Files:
  clang/lib/Serialization/ASTWriterDecl.cpp


Index: clang/lib/Serialization/ASTWriterDecl.cpp
===================================================================
--- clang/lib/Serialization/ASTWriterDecl.cpp
+++ clang/lib/Serialization/ASTWriterDecl.cpp
@@ -1089,8 +1089,6 @@
     Record.AddStmt(D->getUninstantiatedDefaultArg());
   Code = serialization::DECL_PARM_VAR;
 
-  assert(!D->isARCPseudoStrong()); // can be true of ImplicitParamDecl
-
   // If the assumptions about the DECL_PARM_VAR abbrev are true, use it.  Here
   // we dynamically check for the properties that we optimize for, but don't
   // know are true of all PARM_VAR_DECLs.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74417.243890.patch
Type: text/x-patch
Size: 603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200211/9f083ff2/attachment-0001.bin>


More information about the cfe-commits mailing list