Fix accessing non-rand struct member in constraints (#6960)

This commit is contained in:
Pawel Kojma
2026-01-28 07:33:16 -05:00
committed by GitHub
parent 76949f00d3
commit 30e6cd9092
3 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -1121,6 +1121,7 @@ class ConstraintExprVisitor final : public VNVisitor {
editSMT(nodep, nodep->fromp(), lsbp, msbp);
}
void visit(AstStructSel* nodep) override {
if (editFormat(nodep)) return;
m_structSel = true;
if (VN_IS(nodep->fromp()->dtypep()->skipRefp(), StructDType)) {
AstNodeExpr* const fromp = nodep->fromp();
@@ -1154,7 +1155,6 @@ class ConstraintExprVisitor final : public VNVisitor {
}
}
iterateChildren(nodep);
if (editFormat(nodep)) return;
FileLine* const fl = nodep->fileline();
AstSFormatF* newp = nullptr;
if (VN_AS(nodep->fromp(), SFormatF)->name() == "%@.%@") {