Merge remote-tracking branch 'origin/topic/vern/vec-slice-bug'

* origin/topic/vern/vec-slice-bug:
  btest to catch vector slice assignment issues
  bug fix for vector slice assignment
This commit is contained in:
Tim Wojtulewicz 2022-01-25 13:52:00 -07:00
commit 0793a38cc5
5 changed files with 32 additions and 11 deletions

View file

@ -3326,19 +3326,10 @@ bool VectorVal::Insert(unsigned int index, ValPtr element)
auto n = vector_val->size();
if ( index < n )
{ // May need to delete previous element
{ // Find location within existing vector elements.
it = std::next(vector_val->begin(), index);
if ( yield_types )
{
if ( *it )
ZVal::DeleteIfManaged(**it, element->GetType());
types_it = std::next(yield_types->begin(), index);
}
else if ( managed_yield )
{
if ( *it )
ZVal::DeleteManagedType(**it);
}
}
else
{