mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Fix WhileStmt to call Stmt(Tag) ctor
Also removed Stmt() default ctor to help ensure derived classes initialize the Stmt tag (and other members).
This commit is contained in:
parent
e891c310fb
commit
76a38caf34
2 changed files with 2 additions and 2 deletions
|
@ -1001,7 +1001,8 @@ TraversalCode EventStmt::Traverse(TraversalCallback* cb) const
|
||||||
|
|
||||||
WhileStmt::WhileStmt(ExprPtr arg_loop_condition,
|
WhileStmt::WhileStmt(ExprPtr arg_loop_condition,
|
||||||
StmtPtr arg_body)
|
StmtPtr arg_body)
|
||||||
: loop_condition(std::move(arg_loop_condition)), body(std::move(arg_body))
|
: Stmt(STMT_WHILE),
|
||||||
|
loop_condition(std::move(arg_loop_condition)), body(std::move(arg_body))
|
||||||
{
|
{
|
||||||
if ( ! loop_condition->IsError() &&
|
if ( ! loop_condition->IsError() &&
|
||||||
! IsBool(loop_condition->GetType()->Tag()) )
|
! IsBool(loop_condition->GetType()->Tag()) )
|
||||||
|
|
|
@ -66,7 +66,6 @@ public:
|
||||||
virtual TraversalCode Traverse(TraversalCallback* cb) const = 0;
|
virtual TraversalCode Traverse(TraversalCallback* cb) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Stmt() {}
|
|
||||||
explicit Stmt(BroStmtTag arg_tag);
|
explicit Stmt(BroStmtTag arg_tag);
|
||||||
|
|
||||||
void AddTag(ODesc* d) const;
|
void AddTag(ODesc* d) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue