ddkilzer added a comment.
Herald added a subscriber: steakhal.

Thanks for implementing this!  For posterity, I wanted to note a couple cases 
that this checker doesn't catch.

1. Under ARC, a more general case of assigning to an `__autoreleasing` 
variable.  (Not sure why anyone would do this, but it's possible to write.)

  @implementation MyClass
  - (BOOL)myError:(NSError * __strong *)error
  {
      NSError __autoreleasing *localError;
  
      @autoreleasepool {
          localError = [[NSError alloc] init];
      }
  
      if (error) {
          *error = localError;
          return YES;
      }
      return NO;
  }
  @end



2. Under MRR, writing to an autoreleasing out parameter that outlives the 
autoreleasePool (similar to the issue that is now found under ARC):

  @implementation MyClass
  - (BOOL)myError:(NSError **)error
  {
      @autoreleasepool {
          if (error) {
              *error = [[[NSError alloc] init] autorelease];
              return YES;
          }
      }
      return NO;
  }
  @end


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81072

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to