fixed bug where appending an empty vector to a vector-of-vector's had no effect

This commit is contained in:
Vern Paxson 2024-03-02 14:17:03 -08:00 committed by Arne Welzel
parent 8b214862c5
commit 54877e9dec
6 changed files with 53 additions and 7 deletions

View file

@ -764,7 +764,7 @@ ExprPtr AddToExpr::Reduce(Reducer* c, StmtPtr& red_stmt) {
red_stmt = MergeStmts(red_stmt1, red_stmt2);
if ( tag == TYPE_VECTOR && (! IsVector(op2->GetType()->Tag()) || ! same_type(t, op2->GetType())) ) {
if ( is_vector_elem_append ) {
auto append = with_location_of(make_intrusive<AppendToExpr>(op1->Duplicate(), op2), this);
auto append_stmt = with_location_of(make_intrusive<ExprStmt>(append), this);