================
@@ -226,6 +226,17 @@ static bool isPossiblyEscaped(ExplodedNode *N, const 
DeclRefExpr *DR) {
           return false;
       }
     }
+
+    if (const SwitchStmt *SS = dyn_cast<SwitchStmt>(S)) {
+      for (const Stmt *CB : dyn_cast<CompoundStmt>(SS->getBody())->body()) {
+        for (const Decl *D : dyn_cast<DeclStmt>(CB)->decls()) {
----------------
NagyDonat wrote:

And this will crash on all statements that are within a switch and not 
`DeclStmt`s (because the `dyn_cast` returns a nullpointer and you're calling a 
method on it).

https://github.com/llvm/llvm-project/pull/82089
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to