From 4c1b76ad270e0a4eeb0a88841e313c4de96dec42 Mon Sep 17 00:00:00 2001 From: gtsoul-tech Date: Fri, 8 Nov 2024 16:07:19 +0200 Subject: [PATCH] cppcheck-suppress derefInvalidIteratorRedundantCheck --- src/rose/rose_build_role_aliasing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rose/rose_build_role_aliasing.cpp b/src/rose/rose_build_role_aliasing.cpp index 60ff8384..f89c280b 100644 --- a/src/rose/rose_build_role_aliasing.cpp +++ b/src/rose/rose_build_role_aliasing.cpp @@ -2223,6 +2223,10 @@ void mergeCluster(RoseGraph &g, const ReportManager &rm, for (it2 = it; it2 != vcluster.end() && cluster.size() < MERGE_GROUP_SIZE_MAX; ++it2) { + if (it2 == vcluster.end()) { + break; + } + // cppcheck-suppress derefInvalidIteratorRedundantCheck RoseVertex v = *it2; NGHolder *h = g[v].suffix.graph.get(); assert(!g[v].suffix.haig); /* should not be here if haig */