Re: I found a Clang analyzer bug!
Re: I found a Clang analyzer bug!
- Subject: Re: I found a Clang analyzer bug!
- From: Matt Neuburg <email@hidden>
- Date: Thu, 20 Mar 2014 10:44:43 -0700
Thanks, Chris; submitted to bug reporter as 16380362. m.
On Mar 20, 2014, at 10:22 AM, Chris Lattner <email@hidden> wrote:
>
> On Mar 19, 2014, at 11:05 AM, Matt Neuburg <email@hidden> wrote:
>
>> There is a leak in this (meaningless, artificially pared-down) code (self is a CALayer subclass):
>>
>> - (void) setup {
>> CAShapeLayer* circle = [CAShapeLayer new];
>> CGMutablePathRef p = CGPathCreateMutable();
>> CGPathAddEllipseInRect(p, nil, CGRectInset(self.bounds, 3, 3));
>> circle.path = p;
>> // CGPathRelease(p);
>>
>> // return // uncomment this line
>>
>> // the four cardinal points
>> NSArray* pts = @[@"N", @"E", @"S", @"W"];
>> for (int i = 0; i < 4; i++) {
>> CATextLayer* t = [CATextLayer new];
>> t.string = pts[i];
>> }
>> }
>>
>> We are not calling CGPathRelease, but the analyzer is silent. Here's the Really Interesting Part: if you uncomment the "return" line, the analyzer correctly complains! Thus I infer that there is something about the lines after "the four cardinal points" that causes the analyzer to lose track of this leak.
>>
>> What's the appropriate way to report this? Should I just use the bugreporter, or does this need to go to the clang folks? Thx - m.
>
> Hi Matt,
>
> The preferred way is to file a bug with apple’s bugreporter, but if you’re interested in using open source builds from clang.llvm.org, you can also file it at http://llvm.org/bugs/ as Sean says.
>
> In this case, the bug is already reported as http://llvm.org/bugs/show_bug.cgi?id=7638.
>
> The issue is that the analyzer has a fixed number of loop iterations that it is willing to evaluate before it decides that going farther would be good expensive.
>
> -Chris
--
matt neuburg, phd = http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden