diff --git a/src/Expr.cc b/src/Expr.cc index f1a05039d9..4df7b8485b 100644 --- a/src/Expr.cc +++ b/src/Expr.cc @@ -939,7 +939,7 @@ IncrExpr::IncrExpr(BroExprTag arg_tag, IntrusivePtr arg_op) } IntrusivePtr IncrExpr::DoSingleEval(Frame* f, Val* v) const - { + { bro_int_t k = v->CoerceToInt(); if ( Tag() == EXPR_INCR ) @@ -953,15 +953,15 @@ IntrusivePtr IncrExpr::DoSingleEval(Frame* f, Val* v) const RuntimeError("count underflow"); } - BroType* ret_type = Type(); - if ( IsVector(ret_type->Tag()) ) - ret_type = Type()->YieldType(); + BroType* ret_type = Type(); + if ( IsVector(ret_type->Tag()) ) + ret_type = Type()->YieldType(); if ( ret_type->Tag() == TYPE_INT ) return {AdoptRef{}, val_mgr->GetInt(k)}; else return {AdoptRef{}, val_mgr->GetCount(k)}; - } + } IntrusivePtr IncrExpr::Eval(Frame* f) const @@ -988,7 +988,6 @@ IntrusivePtr IncrExpr::Eval(Frame* f) const op->Assign(f, std::move(v_vec)); return v; } - else { auto new_v = DoSingleEval(f, v.get()); @@ -2511,7 +2510,6 @@ IndexExpr::IndexExpr(IntrusivePtr arg_op1, else ExprError("Unknown MatchesIndex() return value"); - } bool IndexExpr::CanAdd() const @@ -4739,7 +4737,6 @@ IntrusivePtr ListExpr::AddSetInit(const BroType* t, IntrusivePtr aggr) if ( ! tv->ExpandAndInit(std::move(element), nullptr) ) return nullptr; - } return aggr;