Fix purity calculation during V3Const simplifying Ast

This commit is contained in:
Wilson Snyder
2023-10-15 06:25:42 -04:00
parent 46f8a659b3
commit 684aba0e90
9 changed files with 12 additions and 43 deletions
+1 -1
View File
@@ -1469,9 +1469,9 @@ private:
beginp = new AstExprStmt{nodep->fileline(), beginp, outrefp};
// AstExprStmt is currently treated as impure, so clear the cached purity of its
// parents
nodep->clearCachedPurity();
nodep->replaceWith(beginp);
VL_DO_DANGLING(nodep->deleteTree(), nodep);
VIsCached::clearCacheTree();
} else {
insertBeforeStmt(nodep, beginp);
if (nodep->taskp()->isFunction()) {