summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-12-11 11:03:38 -0800
committerArtem Dergachev <artem.dergachev@gmail.com>2019-12-11 11:22:36 -0800
commitb01012b7c8a547c0c4f34734a432ee9ba780a6c8 (patch)
tree2295bebd44919d3fc366c85e08c63bd9adaf41ab /clang/lib
parent2b3f2071ec6561c3f10e5291289c47bb3629e354 (diff)
downloadbcm5719-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')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/LocalizationChecker.cpp5
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);
OpenPOWER on IntegriCloud