Fix V3Tristate t_tri_select crash

This commit is contained in:
Wilson Snyder 2012-03-07 22:42:47 -05:00
parent 1c3de70155
commit 04f910b747
1 changed files with 7 additions and 2 deletions

View File

@ -440,7 +440,8 @@ private:
); );
selp->replaceWith(new AstVarRef(refp->fileline(), newlhsp, true)); selp->replaceWith(new AstVarRef(refp->fileline(), newlhsp, true));
selp->deleteTree(); pushDeletep(selp); // Setting selp here or deleting immediately
// breaks the t_tri_select test, this probably indicates a problem
} else { } else {
refp->varp(newlhsp); // assign the new var to the varref refp->varp(newlhsp); // assign the new var to the varref
refp->name(newlhsp->name()); refp->name(newlhsp->name());
@ -570,7 +571,7 @@ private:
new AstVarRef(nodep->fileline(), enp, true)); new AstVarRef(nodep->fileline(), enp, true));
AstVarRef *rp = findVarRef(pinp); AstVarRef *rp = findVarRef(pinp);
rp->replaceWith(new AstVarRef(nodep->fileline(), enp, true)); rp->replaceWith(new AstVarRef(nodep->fileline(), enp, true));
rp->deleteTree(); rp->deleteTree(); rp=NULL;
pinp->width(enp->width(),enp->width()); // minwidth==width pinp->width(enp->width(),enp->width()); // minwidth==width
pinp->modVarp(enchildp); pinp->modVarp(enchildp);
m_cellp->addPinsp(pinp); m_cellp->addPinsp(pinp);
@ -590,6 +591,9 @@ private:
public: public:
// CONSTUCTORS // CONSTUCTORS
TristateVisitor(AstNode* nodep) { TristateVisitor(AstNode* nodep) {
m_modp = NULL;
m_cellp = NULL;
m_unique = false;
nodep->accept(*this); nodep->accept(*this);
} }
virtual ~TristateVisitor() { } virtual ~TristateVisitor() { }
@ -715,6 +719,7 @@ public:
m_modp = NULL; m_modp = NULL;
m_cellp = NULL; m_cellp = NULL;
m_ftaskp = NULL; m_ftaskp = NULL;
m_state = CONVERT_VARS;
nodep->accept(*this); nodep->accept(*this);
} }
virtual ~InoutVisitor() { } virtual ~InoutVisitor() { }