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
+1 -1
View File
@@ -1000,7 +1000,7 @@ static void eliminate(AstNode* logicp,
// Substitute in the new tree
UASSERT_OBJ(nodep->access().isReadOnly(), nodep,
"Can't replace lvalue assignments with const var");
UASSERT_OBJ(!(VN_IS(substp, NodeVarRef) && nodep->same(substp)),
UASSERT_OBJ(!(VN_IS(substp, NodeVarRef) && nodep->isSame(substp)),
// Prevent an infinite loop...
substp, "Replacing node with itself; perhaps circular logic?");
// The replacement