Disable Subst when not pure

This commit is contained in:
Wilson Snyder 2023-09-08 21:52:33 -04:00
parent 2f2f0164ff
commit cdd8953085
2 changed files with 5 additions and 2 deletions

View File

@ -2053,7 +2053,7 @@ private:
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
return true;
}
} else if (m_doV && VN_IS(nodep->lhsp(), Concat)) {
} else if (m_doV && VN_IS(nodep->lhsp(), Concat) && nodep->isTreePureRecurse()) {
bool need_temp = false;
if (m_warn && !VN_IS(nodep, AssignDly)) { // Is same var on LHS and RHS?
// Note only do this (need user4) when m_warn, which is

View File

@ -198,7 +198,10 @@ private:
}
}
void visit(AstConst*) override {} // Accelerate
void visit(AstNode* nodep) override { iterateChildren(nodep); }
void visit(AstNode* nodep) override {
if (!nodep->isPure()) m_ok = false;
iterateChildren(nodep);
}
public:
// CONSTRUCTORS