Bugfix: vectors in records were not initalized.

Closes #421.
This commit is contained in:
Robin Sommer 2011-05-10 18:19:27 -07:00
parent 0815ea9188
commit 63f7359e1e
3 changed files with 20 additions and 1 deletions

View file

@ -2866,7 +2866,7 @@ RecordVal::RecordVal(RecordType* t) : MutableVal(t)
else if ( tag == TYPE_TABLE ) else if ( tag == TYPE_TABLE )
def = new TableVal(type->AsTableType(), a); def = new TableVal(type->AsTableType(), a);
else if ( t->Tag() == TYPE_VECTOR ) else if ( tag == TYPE_VECTOR )
def = new VectorVal(type->AsVectorType()); def = new VectorVal(type->AsVectorType());
} }

View file

@ -0,0 +1,5 @@
[a={
}, b={
}, c=[]]

View file

@ -0,0 +1,14 @@
# @TEST-EXEC: bro %INPUT >output 2>&1
# @TEST-EXEC: btest-diff output
# Make sure composit types in records are initialized.
type Foo: record {
a: set[count];
b: table[count] of string;
c: vector of string;
};
global f: Foo;
print f;