mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fixing bug with deleting still unset record fields of table type.
This commit is contained in:
parent
59d6202104
commit
c41da9ca99
3 changed files with 19 additions and 1 deletions
|
@ -2883,7 +2883,7 @@ RecordVal::~RecordVal()
|
|||
|
||||
void RecordVal::Assign(int field, Val* new_val, Opcode op)
|
||||
{
|
||||
if ( Lookup(field) &&
|
||||
if ( new_val && Lookup(field) &&
|
||||
record_type->FieldType(field)->Tag() == TYPE_TABLE &&
|
||||
new_val->AsTableVal()->FindAttr(ATTR_MERGEABLE) )
|
||||
{
|
||||
|
|
1
testing/btest/Baseline/language.delete-field-set/output
Normal file
1
testing/btest/Baseline/language.delete-field-set/output
Normal file
|
@ -0,0 +1 @@
|
|||
[a=<uninitialized>, b=<uninitialized>, c=<uninitialized>]
|
17
testing/btest/language/delete-field-set.bro
Normal file
17
testing/btest/language/delete-field-set.bro
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
# @TEST-EXEC: bro %INPUT >output 2>&1
|
||||
# @TEST-EXEC: btest-diff output
|
||||
|
||||
type FooBar: record {
|
||||
a: set[string] &default=set();
|
||||
b: table[string] of count &default=table();
|
||||
c: vector of string &default=vector();
|
||||
};
|
||||
|
||||
global test: FooBar;
|
||||
|
||||
delete test$a;
|
||||
delete test$b;
|
||||
delete test$c;
|
||||
|
||||
print test;
|
Loading…
Add table
Add a link
Reference in a new issue