From b60ad953c48b199b77c20dfe2c9a62de25d5fda8 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Tue, 16 Sep 2025 20:23:05 +0200 Subject: [PATCH] Disable multi-threading in V3FuncOpt (#6440) This code is not thread safe. Specifically AstNode constructors are not thread safe, as they may create entries in the shared Dtype table via which can be racy. --- src/V3FuncOpt.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/V3FuncOpt.cpp b/src/V3FuncOpt.cpp index 67af6296f..123acdf6b 100644 --- a/src/V3FuncOpt.cpp +++ b/src/V3FuncOpt.cpp @@ -324,13 +324,12 @@ void V3FuncOpt::funcOptAll(AstNetlist* nodep) { UINFO(2, __FUNCTION__ << ":"); { const VNUser1InUse user1InUse; - V3ThreadScope threadScope; for (AstNodeModule *modp = nodep->modulesp(), *nextModp; modp; modp = nextModp) { nextModp = VN_AS(modp->nextp(), NodeModule); for (AstNode *stmtp = modp->stmtsp(), *nextStmtp; stmtp; stmtp = nextStmtp) { nextStmtp = stmtp->nextp(); if (AstCFunc* const cfuncp = VN_CAST(stmtp, CFunc)) { - threadScope.enqueue([cfuncp]() { FuncOptVisitor::apply(cfuncp); }); + FuncOptVisitor::apply(cfuncp); } } }