support for constructing VectorVal's directly from underlying ZVal vectors

This commit is contained in:
Vern Paxson 2021-05-30 17:58:53 -07:00
parent fb01f6fdef
commit e06d988bfd
2 changed files with 10 additions and 2 deletions

View file

@ -3223,9 +3223,15 @@ ValPtr TypeVal::DoClone(CloneState* state)
return {NewRef{}, this};
}
VectorVal::VectorVal(VectorTypePtr t) : Val(t)
VectorVal::VectorVal(VectorTypePtr t) :
VectorVal(t, new vector<std::optional<ZVal>>())
{
vector_val = new vector<std::optional<ZVal>>();
}
VectorVal::VectorVal(VectorTypePtr t, std::vector<std::optional<ZVal>>* vals)
: Val(t)
{
vector_val = vals;
yield_type = t->Yield();
auto y_tag = yield_type->Tag();