mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Improve type checking of records, addresses BIT-1159.
This commit is contained in:
parent
0f3ed1a553
commit
b1fd161274
13 changed files with 118 additions and 58 deletions
|
@ -169,8 +169,14 @@ static void make_var(ID* id, BroType* t, init_class c, Expr* init,
|
|||
{
|
||||
Val* aggr;
|
||||
if ( t->Tag() == TYPE_RECORD )
|
||||
{
|
||||
aggr = new RecordVal(t->AsRecordType());
|
||||
|
||||
if ( init && t )
|
||||
// Have an initialization and type is not deduced.
|
||||
init = new RecordCoerceExpr(init, t->AsRecordType());
|
||||
}
|
||||
|
||||
else if ( t->Tag() == TYPE_TABLE )
|
||||
aggr = new TableVal(t->AsTableType(), id->Attrs());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue