Page MenuHomePhabricator

[analyzer] Support for OSObjects out parameters in RetainCountChecker
ClosedPublic

Authored by george.karpenkov on Jan 2 2019, 7:16 PM.

Diff Detail

Event Timeline

Moved logic into the summary manager.

Moved attributes into a separate revision.

george.karpenkov edited the summary of this revision. (Show Details)

Support custom diagnostics.

NoQ added inline comments.Jan 8 2019, 7:08 PM
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
535

Mmm, what does L stand for here?

541–545

std::any_of()?

clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp
867

Typo: "because".

clang/test/Analysis/osobject-retain-release.cpp
114

Should we somehow indicate that we assumed that the function returns a success value? I.e., bug visitor / tag.

Also what is the intended behavior if we replace write_into_out_param_on_success with write_into_out_param_on_failure here?

114

That is, i really want this test added, and then it's good to commit, other nits are minor.

george.karpenkov marked 4 inline comments as done.Jan 11 2019, 2:56 PM
george.karpenkov added inline comments.
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
535

vaLue.
Other letters are usually taken =/ Is there a different convention ?

541–545

That's super verbose with iterators and requires putting those values in the array.
Unfortunately, libc++ does not have a

<template T, template Others...>
bool isAnyOf(T Val, Others... OtherVals)

function

george.karpenkov edited the summary of this revision. (Show Details)
NoQ accepted this revision.Jan 11 2019, 3:32 PM

Yay thx.

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
535

L usually stands for Loc; V is more common for raw SVals.

This revision is now accepted and ready to land.Jan 11 2019, 3:32 PM
This revision was automatically updated to reflect the committed changes.