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

David Goldman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 14 11:53:35 PST 2020


dgoldman added a comment.

In D74417#1874826 <https://reviews.llvm.org/D74417#1874826>, @erik.pilkington wrote:

> In D74417#1874747 <https://reviews.llvm.org/D74417#1874747>, @dgoldman wrote:
>
> > Added but it's still failing due to a different assertion failure, do you think this could be because the abbreviation is different for the ParamVars? I'm not sure how to handle this...
>
>
> Yeah, that looks to be the problem, the parameter abbreviation is assumed to be a literal zero (since it was previously impossible) for the ParmVarDecl case, i.e:
>
>   Abv->Add(BitCodeAbbrevOp(0));                       // ARCPseudoStrong
>   
>
> But we really want it to look like the VarDecl case, where we actually get a bit for it:
>
>   Abv->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // isARCPseudoStrong
>   
>
> I think you can fix the crash by changing the BitCodeAbbrevOp(0) to BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1).


Okay, I've added this, it seems to fix the test but I'm not sure if it's fully correct since the place where it was modified is under the `VarDecl` comment instead of `ParmVarDecl`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74417





More information about the cfe-commits mailing list