mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Merge branch 'master' into topic/v6-addr
Conflicts: src/bro.bif
This commit is contained in:
commit
2e2f8f5d06
56 changed files with 1380 additions and 610 deletions
21
src/Expr.cc
21
src/Expr.cc
|
@ -2419,7 +2419,7 @@ bool RefExpr::DoUnserialize(UnserialInfo* info)
|
|||
}
|
||||
|
||||
AssignExpr::AssignExpr(Expr* arg_op1, Expr* arg_op2, int arg_is_init,
|
||||
Val* arg_val)
|
||||
Val* arg_val, attr_list* arg_attrs)
|
||||
: BinaryExpr(EXPR_ASSIGN,
|
||||
arg_is_init ? arg_op1 : arg_op1->MakeLvalue(), arg_op2)
|
||||
{
|
||||
|
@ -2439,14 +2439,14 @@ AssignExpr::AssignExpr(Expr* arg_op1, Expr* arg_op2, int arg_is_init,
|
|||
|
||||
// We discard the status from TypeCheck since it has already
|
||||
// generated error messages.
|
||||
(void) TypeCheck();
|
||||
(void) TypeCheck(arg_attrs);
|
||||
|
||||
val = arg_val ? arg_val->Ref() : 0;
|
||||
|
||||
SetLocationInfo(arg_op1->GetLocationInfo(), arg_op2->GetLocationInfo());
|
||||
}
|
||||
|
||||
bool AssignExpr::TypeCheck()
|
||||
bool AssignExpr::TypeCheck(attr_list* attrs)
|
||||
{
|
||||
TypeTag bt1 = op1->Type()->Tag();
|
||||
TypeTag bt2 = op2->Type()->Tag();
|
||||
|
@ -2478,6 +2478,21 @@ bool AssignExpr::TypeCheck()
|
|||
return true;
|
||||
}
|
||||
|
||||
if ( bt1 == TYPE_TABLE && op2->Tag() == EXPR_LIST )
|
||||
{
|
||||
attr_list* attr_copy = 0;
|
||||
|
||||
if ( attrs )
|
||||
{
|
||||
attr_copy = new attr_list;
|
||||
loop_over_list(*attrs, i)
|
||||
attr_copy->append((*attrs)[i]);
|
||||
}
|
||||
|
||||
op2 = new TableConstructorExpr(op2->AsListExpr(), attr_copy);
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( bt1 == TYPE_VECTOR && bt2 == bt1 &&
|
||||
op2->Type()->AsVectorType()->IsUnspecifiedVector() )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue