mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Improve &default validation for global vars: exclude sets
This commit is contained in:
parent
4c066ca914
commit
4bf3c6ff22
3 changed files with 7 additions and 6 deletions
|
@ -288,9 +288,9 @@ void Attributes::CheckAttr(Attr* a)
|
|||
{
|
||||
// &default is allowed for global tables, since it's used in initialization
|
||||
// of table fields. it's not allowed otherwise.
|
||||
if ( global_var && ! type->IsSet() && type->Tag() != TYPE_TABLE )
|
||||
if ( global_var && ! type->IsTable() )
|
||||
{
|
||||
Error("&default is not valid for global variables");
|
||||
Error("&default is not valid for global variables except for tables");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue