Improve type checking of records, addresses BIT-1159.

This commit is contained in:
Jon Siwek 2014-03-20 13:54:26 -05:00
parent 0f3ed1a553
commit b1fd161274
13 changed files with 118 additions and 58 deletions

View file

@ -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());