Page MenuHomePhabricator

[analyzer] RetainCount: Fix a crash when a function follows retain/autorelease naming convention but takes no arguments.

Authored by NoQ on Thu, Mar 7, 5:53 PM.

Diff Detail

rC Clang

Event Timeline

NoQ created this revision.Thu, Mar 7, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Mar 7, 5:53 PM
NoQ added a comment.Thu, Mar 7, 5:54 PM

The actual crash happens in RetainCountChecker::evalCall():

912     const Expr *BindReturnTo =
913         (BSmr == BehaviorSummary::IdentityThis)
914             ? cast<CXXMemberCallExpr>(CE)->getImplicitObjectArgument()
915             : CE->getArg(0); // <== here
dcoughlin accepted this revision.Wed, Mar 13, 6:53 PM

Sigh. Looks good!

This revision is now accepted and ready to land.Wed, Mar 13, 6:53 PM
This revision was automatically updated to reflect the committed changes.