From 373a68ec8b77ca470cd0f758207d180b4303a461 Mon Sep 17 00:00:00 2001 From: Johan Bjork Date: Tue, 24 Nov 2015 21:34:07 -0500 Subject: [PATCH] Fix dtype indexing into arrays, bug1007. Signed-off-by: Wilson Snyder --- src/V3Inst.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 64e226d2c..a7ea77af9 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -262,10 +262,11 @@ private: AstVarXRef *newp = new AstVarXRef(nodep->fileline(),varrefp->name () + "__BRA__" + index + "__KET__", "", true); AstVar *varp = varrefp->varp()->cloneTree(true); varp->name(varp->name() + "__TMP__" + "__BRA__" + index + "__KET__"); - varp->dtypep(arrp->subDTypep()->backp()->castIfaceRefDType()); + if (!nodep->modVarp()->dtypep()) nodep->v3fatalSrc("No dtype for AstPin"); + varp->dtypep(nodep->modVarp()->dtypep()); newp->addNextHere(varp); newp->varp(varp); - newp->dtypep(arrp->subDTypep()->castIfaceRefDType()); + newp->dtypep(nodep->modVarp()->dtypep()); newp->packagep(varrefp->packagep()); arrselp->addNextHere(newp); arrselp->unlinkFrBack()->deleteTree();