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:
Jon Siwek 2020-07-06 12:22:23 -07:00
parent e891c310fb
commit 76a38caf34
2 changed files with 2 additions and 2 deletions

View file

@ -1001,7 +1001,8 @@ TraversalCode EventStmt::Traverse(TraversalCallback* cb) const
WhileStmt::WhileStmt(ExprPtr arg_loop_condition,
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() &&
! IsBool(loop_condition->GetType()->Tag()) )

View file

@ -66,7 +66,6 @@ public:
virtual TraversalCode Traverse(TraversalCallback* cb) const = 0;
protected:
Stmt() {}
explicit Stmt(BroStmtTag arg_tag);
void AddTag(ODesc* d) const;