diff options
author | Artem Dergachev <artem.dergachev@gmail.com> | 2019-03-29 22:57:49 +0000 |
---|---|---|
committer | Artem Dergachev <artem.dergachev@gmail.com> | 2019-03-29 22:57:49 +0000 |
commit | 388e19ff1f10aa251fdae4cdfd729944c440eac4 (patch) | |
tree | 3f594c1b6b0719981d7521dce0686d20079efb93 /clang/lib | |
parent | e3a845e25ecc541f37dac31c7f2d6c5e7eb5c310 (diff) | |
download | bcm5719-llvm-388e19ff1f10aa251fdae4cdfd729944c440eac4.tar.gz bcm5719-llvm-388e19ff1f10aa251fdae4cdfd729944c440eac4.zip |
[analyzer] PR41239: Fix a crash on invalid source location in NoStoreFuncVisitor.
It turns out that SourceManager::isInSystemHeader() crashes when an invalid
source location is passed into it. Invalid source locations are relatively
common: not only they come from body farms, but also, say, any function in C
that didn't come with a forward declaration would have an implicit
forward declaration with invalid source locations.
There's a more comfy API for us to use in the Static Analyzer:
CallEvent::isInSystemHeader(), so just use that.
Differential Revision: https://reviews.llvm.org/D59901
llvm-svn: 357329
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp index 1bbc0dbc022..1576c09e421 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp @@ -322,7 +322,7 @@ public: CallEventRef<> Call = BR.getStateManager().getCallEventManager().getCaller(SCtx, State); - if (SM.isInSystemHeader(Call->getDecl()->getSourceRange().getBegin())) + if (Call->isInSystemHeader()) return nullptr; // Region of interest corresponds to an IVar, exiting a method |