Fix some AstExprStmt handling issues, towards side effect fixes.

This commit is contained in:
Wilson Snyder
2023-05-27 12:43:40 -04:00
parent 70b82f1aec
commit 1069652701
6 changed files with 48 additions and 3 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ class SliceVisitor final : public VNVisitor {
: offset));
newp = new AstArraySel{nodep->fileline(), snodep->fromp()->cloneTree(false), leOffset};
} else if (VN_IS(nodep, ArraySel) || VN_IS(nodep, NodeVarRef) || VN_IS(nodep, NodeSel)
|| VN_IS(nodep, CMethodHard) || VN_IS(nodep, MemberSel)) {
|| VN_IS(nodep, CMethodHard) || VN_IS(nodep, MemberSel)
|| VN_IS(nodep, ExprStmt)) {
UINFO(9, " cloneSel(" << elements << "," << offset << ") " << nodep << endl);
const int leOffset = !arrayp->rangep()->ascending()
? arrayp->rangep()->elementsConst() - 1 - offset