Fix copy() to work with a vector that has trailing holes

Previously, the trailing holes would not be preserved in the copy.
This commit is contained in:
Jon Siwek 2021-04-19 19:23:04 -07:00
parent d00748a2e7
commit 819fc1aac0
3 changed files with 7 additions and 2 deletions

View file

@ -3706,8 +3706,7 @@ ValPtr VectorVal::DoClone(CloneState* state)
for ( auto i = 0; i < n; ++i )
{
auto elem = At(i);
if ( elem )
vv->Assign(i, elem->Clone(state));
vv->Assign(i, elem ? elem->Clone(state) : nullptr);
}
return vv;