Fix randcase under fork (#6843).

This commit is contained in:
Wilson Snyder
2025-12-20 21:25:01 -05:00
parent f990dd747e
commit ffa87540cc
4 changed files with 44 additions and 0 deletions
+1
View File
@@ -2634,6 +2634,7 @@ class RandomizeVisitor final : public VNVisitor {
const std::string name = "__Vrandcase" + cvtToStr(m_randCaseNum++);
AstVar* const randVarp = new AstVar{fl, VVarType::BLOCKTEMP, name, sumDTypep};
randVarp->noSubst(true);
randVarp->lifetime(VLifetime::AUTOMATIC_EXPLICIT);
if (m_ftaskp) randVarp->funcLocal(true);
AstNodeExpr* sump = new AstConst{fl, AstConst::WidthedValue{}, 64, 0};
AstNodeIf* const firstIfsp