[PATCH] D71091: Make sure that the implicit arguments for direct methods have been setup

Pierre Habouzit via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 12:34:56 PST 2019


MadCoder added a comment.

In D71091#1775722 <https://reviews.llvm.org/D71091#1775722>, @liuliu wrote:

> We don't use PCH :) I arc patched the latest diff, still have that crash. More strangely, I tried this latest diff on previously simplistic test case and it crashes now:
>
>   #import <Foundation/Foundation.h>
>  
>   @interface SCTestMainEntity : NSObject
>  
>   @property (nonatomic, readonly, direct) int date;
>  
>   - (instancetype)initWithDate:(int)date;
>  
>   @end
>  
>   int main(void)
>   {
>       SCTestMainEntity *entity = [[SCTestMainEntity alloc] initWithDate:10];
>       printf("%d\n", entity.date);
>       return 0;
>   }
>


Ugh, you're right, and that's because my test is missing one case. doh.

you can work-around by re-redefining `-(int)date __attribute__((objc_direct));` next to the property. it works in the test beacuse the call site picks up the implementation to form the call. sigh.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71091





More information about the cfe-commits mailing list