fix for tracking the effects of += operations

This commit is contained in:
Vern Paxson 2021-05-30 17:32:29 -07:00
parent 4ee8bd0082
commit 9ba7e95bad

View file

@ -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 // must not be any assignments to aggregates of the same
// type(s). This is to deal with possible aliases. // 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 // * No propagation of expressions that are based on aggregates
// across function calls. // across function calls.
@ -944,6 +945,15 @@ TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e)
return TC_ABORTALL; 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; break;
case EXPR_CALL: case EXPR_CALL: