mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
-O gen-C++ fixes for compatibility with GH-3249 changes
minor -O gen-C++ BTest updates
This commit is contained in:
parent
85cd1d69a4
commit
80eed34985
6 changed files with 19 additions and 8 deletions
|
@ -541,7 +541,9 @@ string CPPCompile::GenAddToExpr(const Expr* e, GenType gt, bool top_level)
|
|||
|
||||
if ( t->Tag() == TYPE_VECTOR )
|
||||
{
|
||||
if ( same_type(lhs->GetType(), rhs->GetType()) )
|
||||
auto& rt = rhs->GetType();
|
||||
|
||||
if ( IsVector(rt->Tag()) && same_type(lhs->GetType(), rt) )
|
||||
add_to_func = "vector_vec_append__CPP";
|
||||
else
|
||||
add_to_func = "vector_append__CPP";
|
||||
|
|
|
@ -24,7 +24,8 @@ inline ValPtr vector_append__CPP(VectorValPtr v1, const ValPtr& v2)
|
|||
// Appends vector v2 to the vector v1.
|
||||
inline ValPtr vector_vec_append__CPP(VectorValPtr v1, const VectorValPtr& v2)
|
||||
{
|
||||
v2->AddTo(v1.get(), false);
|
||||
if ( ! v2->AddTo(v1.get(), false) )
|
||||
reporter->CPPRuntimeError("incompatible vector element assignment");
|
||||
return v1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue