[clang] Fix a crash introduced by 3d5e9ab by adding a nullptr check. (PR #90301)

via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 28 13:47:07 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 3ec858bc5d45ee22ca99febd38e1ba188f71022c 9a39e456a41e415cca62866ca093708412871e00 -- clang/test/Analysis/Checkers/WebKit/call-args-regression-traverse-decl-crash.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
index 6a5abf0c9d..ae494de58d 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp
@@ -56,7 +56,8 @@ public:
       bool TraverseClassTemplateDecl(ClassTemplateDecl *Decl) {
         if (isRefType(safeGetName(Decl)))
           return true;
-        return RecursiveASTVisitor<LocalVisitor>::TraverseClassTemplateDecl(Decl);
+        return RecursiveASTVisitor<LocalVisitor>::TraverseClassTemplateDecl(
+            Decl);
       }
 
       bool VisitCallExpr(const CallExpr *CE) {

``````````

</details>


https://github.com/llvm/llvm-project/pull/90301


More information about the cfe-commits mailing list