mirror of
https://github.com/verilator/verilator.git
synced 2026-09-03 16:28:53 +02:00
Fix incorrect temporary insertion in loop conditions with statements (#4873)
When the condition of an AstWhile loop contains a statement (e.g. through an AstExprStmt), temporaries inserted in that statement need to go before that statement, not in the AstWhile precondition.
This commit is contained in:
+3
-1
@@ -176,8 +176,10 @@ class PremitVisitor final : public VNVisitor {
|
||||
if (stmtp->user1SetOnce()) return; \
|
||||
VL_RESTORER(m_assignLhs); \
|
||||
VL_RESTORER(m_stmtp); \
|
||||
VL_RESTORER(m_inWhileCondp); \
|
||||
m_assignLhs = false; \
|
||||
m_stmtp = stmtp
|
||||
m_stmtp = stmtp; \
|
||||
m_inWhileCondp = nullptr
|
||||
|
||||
void visit(AstWhile* nodep) override {
|
||||
UINFO(4, " WHILE " << nodep << endl);
|
||||
|
||||
Reference in New Issue
Block a user