This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Retain count checker for OSObject: recognize OSDynamicCast
ClosedPublic

Authored by george.karpenkov on Oct 11 2018, 11:40 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ accepted this revision.Oct 11 2018, 2:03 PM

Because it's all wrapped into an explicit cast to type *, evaluating cast manually is indeed unnecessary.

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
779 ↗(On Diff #169263)

TODO: Use DynamicTypeInfo to return 0 when cast fails?

clang/test/Analysis/osobject-retain-release.cpp
34 ↗(On Diff #169263)

// no-warnings?

This revision is now accepted and ready to land.Oct 11 2018, 2:03 PM
This revision was automatically updated to reflect the committed changes.