This is an archive of the discontinued LLVM Phabricator instance.

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

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

Diff Detail

Repository
rC Clang

Event Timeline

NoQ created this revision.Mar 7 2019, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2019, 5:53 PM
NoQ added a comment.Mar 7 2019, 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.Mar 13 2019, 6:53 PM

Sigh. Looks good!

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