This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] [NFC] Clean up messy handling of bug categories in RetainCountChecker
ClosedPublic

Authored by george.karpenkov on Jan 17 2019, 4:16 PM.

Details

Reviewers
dcoughlin
NoQ
Summary

A class is not really a class if only one instance can ever exist.

Diff Detail

Event Timeline

NoQ accepted this revision.Jan 17 2019, 7:02 PM
NoQ added inline comments.
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
1268

This code is creepy. On at least one execution path reaching this spot there seems Pred is null due to caching out, and in this case we should not throw a bug report at all.

Also what do we mean by Ctx.addTransition(state, Pred) when Pred is null? I think it simply returns Ctx.getPredecessor() then, and in this case it should crash due to exploded node garbage collection.

But i guess it has always been that way.

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.h
340

& -> & :)

This revision is now accepted and ready to land.Jan 17 2019, 7:02 PM

Committed in 2bdfe0ca7a5903d24a920c8e46db28261eed0543