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

@ -481,10 +481,10 @@ string CPPCompile::GenAddToExpr(const Expr* e, GenType gt, bool top_level) {
if ( t->Tag() == TYPE_VECTOR ) {
auto& rt = rhs->GetType();
if ( IsVector(rt->Tag()) && same_type(lhs->GetType(), rt) )
add_to_func = "vector_vec_append__CPP";
else
if ( e->AsAddToExpr()->IsVectorElemAppend() )
add_to_func = "vector_append__CPP";
else
add_to_func = "vector_vec_append__CPP";
}
else if ( t->Tag() == TYPE_PATTERN )