mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
GH-157: Mark some attributes as not allowed for global variables
This commit is contained in:
parent
a2c7ed5ff6
commit
ec4913ac18
8 changed files with 41 additions and 17 deletions
|
@ -108,7 +108,7 @@ static void make_var(ID* id, BroType* t, init_class c, Expr* init,
|
|||
id->SetType(t);
|
||||
|
||||
if ( attr )
|
||||
id->AddAttrs(new Attributes(attr, t, false));
|
||||
id->AddAttrs(new Attributes(attr, t, false, id->IsGlobal()));
|
||||
|
||||
if ( init )
|
||||
{
|
||||
|
@ -286,7 +286,7 @@ void add_type(ID* id, BroType* t, attr_list* attr)
|
|||
id->MakeType();
|
||||
|
||||
if ( attr )
|
||||
id->SetAttrs(new Attributes(attr, tnew, false));
|
||||
id->SetAttrs(new Attributes(attr, tnew, false, false));
|
||||
}
|
||||
|
||||
static void transfer_arg_defaults(RecordType* args, RecordType* recv)
|
||||
|
@ -304,7 +304,7 @@ static void transfer_arg_defaults(RecordType* args, RecordType* recv)
|
|||
if ( ! recv_i->attrs )
|
||||
{
|
||||
attr_list* a = new attr_list{def};
|
||||
recv_i->attrs = new Attributes(a, recv_i->type, true);
|
||||
recv_i->attrs = new Attributes(a, recv_i->type, true, false);
|
||||
}
|
||||
|
||||
else if ( ! recv_i->attrs->FindAttr(ATTR_DEFAULT) )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue