[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 17:03:00 PDT 2024
https://github.com/rniwa created https://github.com/llvm/llvm-project/pull/90301
None
>From 0e9d10029e6d498d3bc5a319ac0945cf23db230d Mon Sep 17 00:00:00 2001
From: Ryosuke Niwa <rniwa at webkit.org>
Date: Fri, 26 Apr 2024 17:01:35 -0700
Subject: [PATCH] Fix a crash introduced by 3d5e9ab by adding a nullptr check.
---
.../StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
}
More information about the cfe-commits
mailing list