Skip to content

Commit

Permalink
Skip references in dtypes
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Oct 25, 2023
1 parent cf6e362 commit 35f20a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/V3Randomize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RandomizeMarkVisitor final : public VNVisitorConst {
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);
Expand Down Expand Up @@ -100,7 +100,7 @@ class RandomizeMarkVisitor final : public VNVisitorConst {
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);
Expand Down

0 comments on commit 35f20a4

Please sign in to comment.