Fix dtype indexing into arrays, bug1007.

Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
Johan Bjork 2015-11-24 21:34:07 -05:00 committed by Wilson Snyder
parent 5613758ee3
commit 373a68ec8b

View File

@ -262,10 +262,11 @@ private:
AstVarXRef *newp = new AstVarXRef(nodep->fileline(),varrefp->name () + "__BRA__" + index + "__KET__", "", true); AstVarXRef *newp = new AstVarXRef(nodep->fileline(),varrefp->name () + "__BRA__" + index + "__KET__", "", true);
AstVar *varp = varrefp->varp()->cloneTree(true); AstVar *varp = varrefp->varp()->cloneTree(true);
varp->name(varp->name() + "__TMP__" + "__BRA__" + index + "__KET__"); 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->addNextHere(varp);
newp->varp(varp); newp->varp(varp);
newp->dtypep(arrp->subDTypep()->castIfaceRefDType()); newp->dtypep(nodep->modVarp()->dtypep());
newp->packagep(varrefp->packagep()); newp->packagep(varrefp->packagep());
arrselp->addNextHere(newp); arrselp->addNextHere(newp);
arrselp->unlinkFrBack()->deleteTree(); arrselp->unlinkFrBack()->deleteTree();