[clang] [analyzer] Avoid out-of-order node traversal on void return (PR #117863)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 27 03:25:09 PST 2024


================
@@ -347,8 +347,11 @@ const Stmt *ExplodedNode::getStmtForDiagnostics() const {
   return nullptr;
 }
 
-const Stmt *ExplodedNode::getNextStmtForDiagnostics() const {
+const Stmt *ExplodedNode::getNextStmtForDiagnostics(bool skipPurge) const {
   for (const ExplodedNode *N = getFirstSucc(); N; N = N->getFirstSucc()) {
+    if (skipPurge && N->getLocation().isPurgeKind()) {
----------------
Xazax-hun wrote:

Nit: we usually omit braces for single statement branches.

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


More information about the cfe-commits mailing list