From 9ba7e95badfc2a1e7c8720e93f5aa832bae477b7 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Sun, 30 May 2021 17:32:29 -0700 Subject: [PATCH] fix for tracking the effects of += operations --- src/script_opt/Reduce.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/script_opt/Reduce.cc b/src/script_opt/Reduce.cc index c12da4240f..f3d0603879 100644 --- a/src/script_opt/Reduce.cc +++ b/src/script_opt/Reduce.cc @@ -410,7 +410,8 @@ bool Reducer::ExprValid(const ID* id, const Expr* e1, const Expr* e2) const // must not be any assignments to aggregates of the same // type(s). This is to deal with possible aliases. // - // * Same goes to modifications of aggregates via "add" or "delete". + // * Same goes to modifications of aggregates via "add" or "delete" + // or "+=" append. // // * No propagation of expressions that are based on aggregates // across function calls. @@ -944,6 +945,15 @@ TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) return TC_ABORTALL; } } + + case EXPR_APPEND_TO: + // This doesn't directly change any identifiers, but does + // alter an aggregate. + if ( CheckAggrMod(ids, e) ) + { + is_valid = false; + return TC_ABORTALL; + } break; case EXPR_CALL: