Avoid duplicate lookup in NFA property recursion guard (#8321)

Signed-off-by: Artur Bieniek <[email protected]>
This commit is contained in:
Artur Bieniek
2026-09-10 20:46:54 +02:00
committed by GitHub
parent 5b24226b3b
commit b06bd46dc9
+1 -2
View File
@@ -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<const AstProperty*>& setr;
const AstProperty* keyp;