Fix range access to fields under classes that depend on parameter resolution (#4681)

Signed-off-by: Krzysztof Boronski <[email protected]>
This commit is contained in:
Krzysztof Boroński
2023-11-15 14:24:41 +01:00
committed by GitHub
parent 2dba76a7c2
commit cc982ec7fe
5 changed files with 82 additions and 15 deletions
+15 -1
View File
@@ -3343,7 +3343,19 @@ class LinkDotResolveVisitor final : public VNVisitor {
m_ds.init(m_curSymp);
iterateAndNextNull(nodep->rhsp());
iterateAndNextNull(nodep->thsp());
iterateAndNextNull(nodep->attrp());
}
if (nodep->attrp()) {
AstNode* const attrp = nodep->attrp()->unlinkFrBack();
VL_DO_DANGLING(attrp->deleteTree(), attrp);
}
AstNode* const basefromp = AstArraySel::baseFromp(nodep, false);
if (VN_IS(basefromp, Replicate)) {
// From {...}[...] syntax in IEEE 2017
if (basefromp) UINFO(1, " Related node: " << basefromp << endl);
} else {
nodep->attrp(new AstAttrOf{nodep->fileline(), VAttrType::VAR_BASE,
basefromp->cloneTree(false)});
}
}
void visit(AstMemberSel* nodep) override {
@@ -3742,6 +3754,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
iterateChildren(nodep);
}
void visit(AstAttrOf* nodep) override { iterateChildren(nodep); }
void visit(AstNode* nodep) override {
checkNoDot(nodep);
iterateChildren(nodep);