[clang] [analyzer] Check C++ base or member initializer in WebKit checkers. (PR #92220)

Artem Dergachev via cfe-commits cfe-commits at lists.llvm.org
Wed May 15 13:34:28 PDT 2024


================
@@ -525,11 +525,19 @@ bool TrivialFunctionAnalysis::isTrivialImpl(
   if (!IsNew)
     return It->second;
 
+  TrivialFunctionAnalysisVisitor V(Cache);
+
+  if (auto *CtorDecl = dyn_cast<CXXConstructorDecl>(D)) {
+    for (auto *CtorInit : CtorDecl->inits()) {
+      if (!V.Visit(CtorInit->getInit()))
----------------
haoNoQ wrote:

I don't remember if either of these needs a null check. IIRC it's probably ok but if you run into crashes you know where to look ;)

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


More information about the cfe-commits mailing list