File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
clang/lib/StaticAnalyzer/Checkers Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 14
14
//
15
15
// ===----------------------------------------------------------------------===//
16
16
17
+ #include " clang/Analysis/AnalysisDeclContext.h"
17
18
#include " clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
18
19
#include " clang/StaticAnalyzer/Core/BugReporter/BugType.h"
19
20
#include " clang/StaticAnalyzer/Core/Checker.h"
@@ -103,9 +104,10 @@ class RAIIMutexDescriptor {
103
104
// this function is called instead of early returning it. To avoid this, a
104
105
// bool variable (IdentifierInfoInitialized) is used and the function will
105
106
// be run only once.
106
- Guard = &Call.getCalleeAnalysisDeclContext ()->getASTContext ().Idents .get (
107
- GuardName);
108
- IdentifierInfoInitialized = true ;
107
+ if (AnalysisDeclContext *CalleCtx = Call.getCalleeAnalysisDeclContext ()) {
108
+ Guard = &CalleCtx->getASTContext ().Idents .get (GuardName);
109
+ IdentifierInfoInitialized = true ;
110
+ }
109
111
}
110
112
}
111
113
You can’t perform that action at this time.
0 commit comments