]> granicus.if.org Git - clang/commit
[analyzer] Fix crash in RetainCountChecker::checkEndFunction
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Fri, 23 Sep 2016 20:49:01 +0000 (20:49 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Fri, 23 Sep 2016 20:49:01 +0000 (20:49 +0000)
commit714e1790a65be61d287c8290a6302eddb5662b86
tree2fa14915d8306d5368ef8d9bcb55cd5d7f8b899a
parenta428e7b35bc8ded75476c588a86b4d7a2edb788b
[analyzer] Fix crash in RetainCountChecker::checkEndFunction

The class BodyFarm creates bodies for
OSAtomicCompareAndSwap*, objc_atomicCompareAndSwap*, dispatch_sync*, dispatch_once*
and for them the flag isBodyAutosynthesized is set to true.

This diff
1. makes AnalysisConsumer::HandleCode skip the autosynthesized code
2. replaces assert(LCtx->getParent()) in RetainCountChecker::checkEndFunction
by assert(!LCtx->inTopFrame()) (minor cleanup)

Test plan: make -j8 check-clang-analysis

Differential revision: https://reviews.llvm.org/D24792

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282293 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
test/Analysis/NSString.m