mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +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
|
@ -181,7 +181,7 @@ void ID::UpdateValAttrs()
|
|||
TypeDecl* fd = rt->FieldDecl(i);
|
||||
|
||||
if ( ! fd->attrs )
|
||||
fd->attrs = new Attributes(new attr_list, rt->FieldType(i), true);
|
||||
fd->attrs = new Attributes(new attr_list, rt->FieldType(i), true, IsGlobal());
|
||||
|
||||
fd->attrs->AddAttr(new Attr(ATTR_LOG));
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ void ID::MakeDeprecated(Expr* deprecation)
|
|||
return;
|
||||
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_DEPRECATED, deprecation)};
|
||||
AddAttrs(new Attributes(attr, Type(), false));
|
||||
AddAttrs(new Attributes(attr, Type(), false, IsGlobal()));
|
||||
}
|
||||
|
||||
string ID::GetDeprecationWarning() const
|
||||
|
@ -245,7 +245,7 @@ void ID::SetOption()
|
|||
if ( ! IsRedefinable() )
|
||||
{
|
||||
attr_list* attr = new attr_list{new Attr(ATTR_REDEF)};
|
||||
AddAttrs(new Attributes(attr, Type(), false));
|
||||
AddAttrs(new Attributes(attr, Type(), false, IsGlobal()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue