mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
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:
commit
0793a38cc5
5 changed files with 32 additions and 11 deletions
11
src/Val.cc
11
src/Val.cc
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue