Fix removing if assigned to unused var, bug248.

This commit is contained in:
Wilson Snyder
2010-04-19 19:38:22 -04:00
parent 68b63d5783
commit aca4ab015f
3 changed files with 10 additions and 6 deletions
+1 -4
View File
@@ -145,13 +145,10 @@ private:
nodep->lhsp()->iterateAndNext(*this);
}
}
virtual void visit(AstUCFunc* nodep, AstNUser*) {
m_sideEffect = true; // If appears on assign RHS, don't ever delete the assignment
nodep->iterateChildren(*this);
}
//-----
virtual void visit(AstNode* nodep, AstNUser*) {
if (nodep->isOutputter()) m_sideEffect=true;
nodep->iterateChildren(*this);
}