Internals: Fix same() called outside of sameTree (#4561).

This commit is contained in:
Wilson Snyder
2023-10-18 17:36:21 -04:00
parent 8720841c48
commit b7233d063f
6 changed files with 14 additions and 8 deletions
+3 -3
View File
@@ -207,10 +207,10 @@ private:
if (m_mgSelLp) { // Old merge
if (m_mgCfuncp == m_cfuncp // In same function
&& m_mgNextp == nodep // Consecutive node
&& m_mgVarrefLp->same(lvarrefp) // Same array on left hand side
&& m_mgVarrefLp->isSame(lvarrefp) // Same array on left hand side
&& (m_mgConstRp // On the right hand side either ...
? (rconstp && m_mgConstRp->same(rconstp)) // ... same constant
: (rselp && m_mgVarrefRp->same(rvarrefp))) // ... or same array
? (rconstp && m_mgConstRp->isSame(rconstp)) // ... same constant
: (rselp && m_mgVarrefRp->isSame(rvarrefp))) // ... or same array
&& (lindex == m_mgIndexLo - 1 || lindex == m_mgIndexHi + 1) // Left index +/- 1
&& (m_mgConstRp || lindex == rindex + m_mgOffset) // Same right index offset
) {