mirror of
https://github.com/verilator/verilator.git
synced 2026-09-02 10:48:27 +02:00
Fix rand fields of reference types (#4627)
This commit is contained in:
+3
-2
@@ -55,7 +55,8 @@ private:
|
||||
for (auto* memberp = classp->stmtsp(); memberp; memberp = memberp->nextp()) {
|
||||
// If member is rand and of class type, mark its class
|
||||
if (VN_IS(memberp, Var) && VN_AS(memberp, Var)->isRand()) {
|
||||
if (const auto* const classRefp = VN_CAST(memberp->dtypep(), ClassRefDType)) {
|
||||
if (const auto* const classRefp
|
||||
= VN_CAST(memberp->dtypep()->skipRefp(), ClassRefDType)) {
|
||||
auto* const rclassp = classRefp->classp();
|
||||
if (!rclassp->user1()) {
|
||||
rclassp->user1(true);
|
||||
@@ -100,7 +101,7 @@ private:
|
||||
iterateChildrenConst(nodep);
|
||||
if (nodep->name() != "randomize") return;
|
||||
if (const AstClassRefDType* const classRefp
|
||||
= VN_CAST(nodep->fromp()->dtypep(), ClassRefDType)) {
|
||||
= VN_CAST(nodep->fromp()->dtypep()->skipRefp(), ClassRefDType)) {
|
||||
AstClass* const classp = classRefp->classp();
|
||||
classp->user1(true);
|
||||
markMembers(classp);
|
||||
|
||||
Reference in New Issue
Block a user