[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 17:03:28 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Ryosuke Niwa (rniwa)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/90301.diff
1 Files Affected:
- (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp (+1-1)
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
index 741f336761589f..96bae0de65a5b1 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
@@ -54,7 +54,7 @@ class UncountedCallArgsChecker
bool shouldVisitImplicitCode() const { return false; }
bool TraverseDecl(Decl *D) {
- if (isa<ClassTemplateDecl>(D) && isRefType(safeGetName(D)))
+ if (D && isa<ClassTemplateDecl>(D) && isRefType(safeGetName(D)))
return true;
return RecursiveASTVisitor<LocalVisitor>::TraverseDecl(D);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/90301
More information about the cfe-commits
mailing list