I found a Clang analyzer bug!
I found a Clang analyzer bug!
- Subject: I found a Clang analyzer bug!
- From: Matt Neuburg <email@hidden>
- Date: Wed, 19 Mar 2014 11:05:55 -0700
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.
--
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