diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-10-12 22:56:40 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-10-12 22:56:40 +0000 |
commit | 5a8fc88b18793f25d4423805d7e4ac5d0325b9a6 (patch) | |
tree | 84e51a6bc7e500041d4263743bb9ed539d86757c /lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 7642b9a55e853c27531e078da34ca95148182c3d (diff) |
Silence null dereference warnings by documenting context-specific
invariants using assertions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 3338c479be..c84365e4a9 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -2203,6 +2203,7 @@ GetAllocationSite(ProgramStateManager& StateMgr, const ExplodedNode *N, // If allocation happened in a function different from the leak node context, // do not report the binding. + assert(N && "Could not find allocation node"); if (N->getLocationContext() != LeakContext) { FirstBinding = 0; } @@ -2258,6 +2259,7 @@ CFRefLeakReportVisitor::getEndPath(BugReporterContext &BRC, // Get the retain count. const RefVal* RV = getRefBinding(EndN->getState(), Sym); + assert(RV); if (RV->getKind() == RefVal::ErrorLeakReturned) { // FIXME: Per comments in rdar://6320065, "create" only applies to CF @@ -2855,6 +2857,7 @@ void RetainCountChecker::checkSummary(const RetainSummary &Summ, // Consult the summary for the return value. RetEffect RE = Summ.getRetEffect(); + assert(CallOrMsg.getOriginExpr()); if (RE.getKind() == RetEffect::OwnedWhenTrackedReceiver) { if (ReceiverIsTracked) |