From b0e21b7e642fcebaf4a1c664d120660c7fe1a0b1 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Wed, 11 Sep 2024 16:35:54 +0200 Subject: [PATCH] fix for ZAM identification of common subexpressions --- src/script_opt/CSE.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/script_opt/CSE.cc b/src/script_opt/CSE.cc index 6f122468af..a19828c1f3 100644 --- a/src/script_opt/CSE.cc +++ b/src/script_opt/CSE.cc @@ -43,13 +43,14 @@ TraversalCode CSE_ValidityChecker::PreStmt(const Stmt* s) { TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e) { if ( e == start_e ) { - ASSERT(! have_start_e); - have_start_e = true; + if ( ! have_start_e ) { + have_start_e = true; - // Don't analyze the expression, as it's our starting - // point and we don't want to conflate its properties - // with those of any intervening expressions. - return TC_CONTINUE; + // Don't analyze the expression, as it's our starting + // point and we don't want to conflate its properties + // with those of any intervening expressions. + return TC_CONTINUE; + } } if ( e == end_e ) {