[clang] [clang][StaticAnalyzer] Crash on loop unrolling mode (PR #82089)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 22 05:05:16 PST 2024
================
@@ -226,6 +226,21 @@ static bool isPossiblyEscaped(ExplodedNode *N, const DeclRefExpr *DR) {
return false;
}
}
+
+ if (const SwitchStmt *SS = dyn_cast<SwitchStmt>(S)) {
+ if (const CompoundStmt *CST = dyn_cast<CompoundStmt>(SS->getBody())) {
+ for (const Stmt *CB : CST->body()) {
+ if (const DeclStmt *DST = dyn_cast<DeclStmt>(CB)) {
+ for (const Decl *D : DST->decls()) {
+ // Once we reach the declaration of the VD we can return.
+ if (D->getCanonicalDecl() == VD)
+ return false;
+ }
+ }
----------------
huang-me wrote:
Sure, I can do that.
https://github.com/llvm/llvm-project/pull/82089
More information about the cfe-commits
mailing list