mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Fix parse-time RecordVal tracking containing duplicates
The same RecordVal was unintentionally being added to the list within a loop over its fields instead of just once per ctor.
This commit is contained in:
parent
0f2e778216
commit
8d6dbc2d46
3 changed files with 11 additions and 7 deletions
12
src/Val.cc
12
src/Val.cc
|
@ -2887,6 +2887,12 @@ RecordVal::RecordVal(RecordType* t, bool init_fields) : MutableVal(t)
|
|||
int n = record_type->NumFields();
|
||||
val_list* vl = val.val_list_val = new val_list(n);
|
||||
|
||||
if ( is_parsing )
|
||||
{
|
||||
parse_time_records.emplace_back(this);
|
||||
Ref();
|
||||
}
|
||||
|
||||
if ( ! init_fields )
|
||||
return;
|
||||
|
||||
|
@ -2928,12 +2934,6 @@ RecordVal::RecordVal(RecordType* t, bool init_fields) : MutableVal(t)
|
|||
vl->append(def ? def->Ref() : 0);
|
||||
|
||||
Unref(def);
|
||||
|
||||
if ( is_parsing )
|
||||
{
|
||||
parse_time_records.emplace_back(this);
|
||||
Ref();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue