https://github.com/rniwa updated https://github.com/llvm/llvm-project/pull/90301
>From 0e9d10029e6d498d3bc5a319ac0945cf23db230d Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa <rn...@webkit.org> Date: Fri, 26 Apr 2024 17:01:35 -0700 Subject: [PATCH 1/2] 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); } >From 37b5f788e903ce3175e4f961389eb5a1f503c884 Mon Sep 17 00:00:00 2001 From: Ryosuke Niwa <rn...@webkit.org> Date: Sat, 27 Apr 2024 14:03:38 -0700 Subject: [PATCH 2/2] Add a regression test. --- .../WebKit/call-args-regression-traverse-decl-crash.cpp | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 clang/test/Analysis/Checkers/WebKit/call-args-regression-traverse-decl-crash.cpp diff --git a/clang/test/Analysis/Checkers/WebKit/call-args-regression-traverse-decl-crash.cpp b/clang/test/Analysis/Checkers/WebKit/call-args-regression-traverse-decl-crash.cpp new file mode 100644 index 00000000000000..3d8e822025f62b --- /dev/null +++ b/clang/test/Analysis/Checkers/WebKit/call-args-regression-traverse-decl-crash.cpp @@ -0,0 +1,7 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.webkit.UncountedCallArgsChecker -verify %s +// expected-no-diagnostics + +template <class Class> struct T; +template <template <class> class Class, class Type> +struct T<Class<Type>> +{ }; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits