Don't move function calls before the expression (#4413)

This commit is contained in:
Ryszard Rozak
2023-08-28 15:44:41 +02:00
committed by GitHub
parent 63db60f646
commit e24197fd16
15 changed files with 55 additions and 41 deletions
+5 -3
View File
@@ -551,7 +551,9 @@ private:
}
if (!lhsp->backp()) VL_DO_DANGLING(pushDeletep(lhsp), lhsp);
} else {
iterateChildren(nodep);
iterate(nodep->lhsp());
m_inDly = false;
iterate(nodep->rhsp());
}
}
@@ -623,9 +625,9 @@ private:
m_inLoop = true;
iterateChildren(nodep);
}
void visit(AstNodeAssign* nodep) override {
void visit(AstExprStmt* nodep) override {
VL_RESTORER(m_inDly);
// Restoring is needed in nested assignments, like a <= (x = y);
// Restoring is needed, because AstExprStmt may contain assignments
m_inDly = false;
iterateChildren(nodep);
}