[cfe-commits] r153069 - /cfe/trunk/test/Analysis/retain-release.mm

Jordan Rose jediknil at belkadan.com
Mon Mar 19 17:26:15 PDT 2012


On Mar 19, 2012, at 17:10, Ted Kremenek wrote:

> +int rdar10553686_positive(void)
> +{
> +  NSObject* bar = static_objc_cast<NSObject*>([[NSObject alloc] init]); // expected-warning {{Potential leak}}
> +  [bar release];
> +  [bar retain];
> +  return 0;
> +}

Why is this not a use-after-free? Even if there is a valid test here, we shouldn't use an invalid test case. Or am I missing something?



More information about the cfe-commits mailing list