diff --git a/src/V3Task.cpp b/src/V3Task.cpp index 2dc613ca1e..b8612077b8 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1530,8 +1530,7 @@ class TaskVisitor final : public VNVisitor { m_statep->ftaskCFuncp(nodep, cfuncp); } if (nodep->classMethod() && nodep->name() == "randomize") { - AstClass *classp = m_statep->getClassp(nodep); - classp->randomize(cfuncp); + m_statep->getClassp(nodep)->randomize(cfuncp); } iterateIntoFTask(clonedFuncp); // Do the clone too }