V3MergeCond: Fix incorrect merge of assignments to the condition

This commit is contained in:
Geza Lore
2022-07-28 15:50:02 +01:00
parent 2a87387eb3
commit 574dbfded1
3 changed files with 44 additions and 0 deletions
+2
View File
@@ -790,6 +790,8 @@ private:
// otherwise end the current merge. Return ture if added, false if ended merge.
bool addIfHelpfulElseEndMerge(AstNodeStmt* nodep) {
UASSERT_OBJ(m_mgFirstp, nodep, "List must be open");
if (!checkOrMakeMergeable(nodep)) return false;
if (!m_mgFirstp) return false; // If 'checkOrMakeMergeable' closed the list
if (m_mgNextp == nodep) {
if (isSimplifiableNode(nodep)) {
if (addToList(nodep, nullptr)) return true;