diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-12-11 11:03:38 -0800 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-12-11 11:22:36 -0800 |
commit | b01012b7c8a547c0c4f34734a432ee9ba780a6c8 (patch) | |
tree | 2295bebd44919d3fc366c85e08c63bd9adaf41ab /clang/lib/StaticAnalyzer | |
parent | 2b3f2071ec6561c3f10e5291289c47bb3629e354 (diff) | |
download | bcm5719-llvm-b01012b7c8a547c0c4f34734a432ee9ba780a6c8.tar.gz bcm5719-llvm-b01012b7c8a547c0c4f34734a432ee9ba780a6c8.zip |
[analyzer] LocalizationChecker: Fix a crash on synthesized accessor stubs.
The checker was trying to analyze the body of every method in Objective-C
@implementation clause but the sythesized accessor stubs that were introduced
into it by 2073dd2d have no bodies.
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp index a81015b6e52..79de1844e74 100644 --- a/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp @@ -1077,7 +1077,10 @@ void EmptyLocalizationContextChecker::checkASTDecl( AnalysisDeclContext *DCtx = Mgr.getAnalysisDeclContext(M); const Stmt *Body = M->getBody(); - assert(Body); + if (!Body) { + assert(M->isSynthesizedAccessorStub()); + continue; + } MethodCrawler MC(M->getCanonicalDecl(), BR, this, Mgr, DCtx); MC.VisitStmt(Body); |