mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/bit-1373'
* origin/topic/jsiwek/bit-1373: BIT-1373: fix vector index assignment ref count bug. BIT-1373 #merged
This commit is contained in:
commit
4e68ce4726
3 changed files with 11 additions and 3 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
|||
|
||||
2.3-838 | 2015-04-21 13:40:12 -0700
|
||||
|
||||
* BIT-1373: Fix vector index assignment reference count bug. (Jon Siwek)
|
||||
|
||||
2.3-836 | 2015-04-21 13:37:31 -0700
|
||||
|
||||
* Fix SSH direction field being unset. Addresses BIT-1365. (Vlad
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
2.3-836
|
||||
2.3-838
|
||||
|
|
|
@ -2985,8 +2985,10 @@ bool VectorVal::Assign(unsigned int index, Val* element, Opcode op)
|
|||
}
|
||||
}
|
||||
|
||||
Val* val_at_index = 0;
|
||||
|
||||
if ( index < val.vector_val->size() )
|
||||
Unref((*val.vector_val)[index]);
|
||||
val_at_index = (*val.vector_val)[index];
|
||||
else
|
||||
val.vector_val->resize(index + 1);
|
||||
|
||||
|
@ -2999,10 +3001,12 @@ bool VectorVal::Assign(unsigned int index, Val* element, Opcode op)
|
|||
|
||||
StateAccess::Log(new StateAccess(op == OP_INCR ?
|
||||
OP_INCR_IDX : OP_ASSIGN_IDX,
|
||||
this, ival, element, (*val.vector_val)[index]));
|
||||
this, ival, element, val_at_index));
|
||||
Unref(ival);
|
||||
}
|
||||
|
||||
Unref(val_at_index);
|
||||
|
||||
// Note: we do *not* Ref() the element, if any, at this point.
|
||||
// AssignExpr::Eval() already does this; other callers must remember
|
||||
// to do it similarly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue