From b06bd46dc9ab1d43fe4523aa4bc634eac21f9db4 Mon Sep 17 00:00:00 2001 From: Artur Bieniek Date: Thu, 10 Sep 2026 20:46:54 +0200 Subject: [PATCH] Avoid duplicate lookup in NFA property recursion guard (#8321) Signed-off-by: Artur Bieniek --- src/V3AssertNfa.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/V3AssertNfa.cpp b/src/V3AssertNfa.cpp index 2bd03e9d4..8c4a07d5d 100644 --- a/src/V3AssertNfa.cpp +++ b/src/V3AssertNfa.cpp @@ -2947,11 +2947,10 @@ class AssertNfaVisitor final : public VNVisitor { // Recursion guard: IEEE 1800-2023 16.12.1 forbids recursive properties. // V3Width emits "Recursive property call" for direct recursion before this // pass runs; this catches any nested-inlining cycle that slips past. - if (m_inliningProps.count(propyp)) { + if (!m_inliningProps.emplace(propyp).second) { funcrefp->v3error("Illegal recursive property reference"); // LCOV_EXCL_LINE return; // LCOV_EXCL_LINE } - m_inliningProps.insert(propyp); struct Guard final { std::set& setr; const AstProperty* keyp;