fix for ZAM identification of common subexpressions

This commit is contained in:
Vern Paxson 2024-09-11 16:35:54 +02:00 committed by Christian Kreibich
parent e0e6c462ce
commit b0e21b7e64

View file

@ -43,13 +43,14 @@ TraversalCode CSE_ValidityChecker::PreStmt(const Stmt* s) {
TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) { TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) {
if ( e == start_e ) { if ( e == start_e ) {
ASSERT(! have_start_e); if ( ! have_start_e ) {
have_start_e = true; have_start_e = true;
// Don't analyze the expression, as it's our starting // Don't analyze the expression, as it's our starting
// point and we don't want to conflate its properties // point and we don't want to conflate its properties
// with those of any intervening expressions. // with those of any intervening expressions.
return TC_CONTINUE; return TC_CONTINUE;
}
} }
if ( e == end_e ) { if ( e == end_e ) {