mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
binpac: Allow more than one &require attribute on a field.
Patch by François Pennaneach <francois.pennaneach@free.fr>. BIT-1753 #close
This commit is contained in:
parent
ffe92f487f
commit
e4c168836e
2 changed files with 9 additions and 6 deletions
|
@ -60,7 +60,7 @@ Type::Type(TypeType tot)
|
|||
attr_multiline_end_ = 0;
|
||||
attr_oneline_ = false;
|
||||
attr_refcount_ = false;
|
||||
attr_requires_ = 0;
|
||||
attr_requires_ = new ExprList();
|
||||
attr_restofdata_ = false;
|
||||
attr_restofflow_ = false;
|
||||
attr_transient_ = false;
|
||||
|
@ -80,7 +80,7 @@ Type::~Type()
|
|||
delete attr_if_expr_;
|
||||
delete attr_length_expr_;
|
||||
delete_list(ExprList, attr_checks_);
|
||||
delete attr_requires_;
|
||||
delete_list(ExprList, attr_requires_);
|
||||
}
|
||||
|
||||
Type *Type::Clone() const
|
||||
|
@ -203,7 +203,7 @@ void Type::ProcessAttr(Attr* a)
|
|||
break;
|
||||
|
||||
case ATTR_REQUIRES:
|
||||
attr_requires_ = a->expr();
|
||||
attr_requires_->push_back(a->expr());
|
||||
break;
|
||||
|
||||
case ATTR_TRANSIENT:
|
||||
|
@ -723,8 +723,11 @@ void Type::GenParseCode2(Output* out_cc, Env* env,
|
|||
|
||||
void Type::GenParseCode3(Output* out_cc, Env* env, const DataPtr& data, int flags)
|
||||
{
|
||||
if ( attr_requires_ )
|
||||
attr_requires_->EvalExpr(out_cc, env);
|
||||
foreach(i, ExprList, attr_requires_)
|
||||
{
|
||||
Expr *req = *i;
|
||||
req->EvalExpr(out_cc, env);
|
||||
}
|
||||
|
||||
foreach(i, FieldList, fields_)
|
||||
{
|
||||
|
|
|
@ -290,7 +290,7 @@ protected:
|
|||
Expr *attr_multiline_end_;
|
||||
bool attr_oneline_;
|
||||
bool attr_refcount_;
|
||||
Expr *attr_requires_;
|
||||
ExprList *attr_requires_;
|
||||
bool attr_restofdata_;
|
||||
bool attr_restofflow_;
|
||||
bool attr_transient_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue