mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
bug-squashing
This commit is contained in:
parent
039e670097
commit
25b71c7d66
3 changed files with 5 additions and 11 deletions
|
@ -717,7 +717,6 @@ public:
|
||||||
// Optimization-related:
|
// Optimization-related:
|
||||||
bool IsReduced(Reducer* c) const override { return HasReducedOps(c); }
|
bool IsReduced(Reducer* c) const override { return HasReducedOps(c); }
|
||||||
bool HasReducedOps(Reducer* c) const override { return op->HasReducedOps(c); }
|
bool HasReducedOps(Reducer* c) const override { return op->HasReducedOps(c); }
|
||||||
ExprPtr Reduce(Reducer* c, StmtPtr& red_stmt) override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class AggrAddExpr final : public AggrAddDelExpr {
|
class AggrAddExpr final : public AggrAddDelExpr {
|
||||||
|
|
|
@ -2537,6 +2537,11 @@ TypePtr init_type(const detail::ExprPtr& init) {
|
||||||
if ( init->Tag() != detail::EXPR_LIST ) {
|
if ( init->Tag() != detail::EXPR_LIST ) {
|
||||||
auto t = init->InitType();
|
auto t = init->InitType();
|
||||||
|
|
||||||
|
if ( ! t ) {
|
||||||
|
init->Error("not a valid initializer");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (t->Tag() == TYPE_TABLE && cast_intrusive<TableType>(t)->IsUnspecifiedTable()) ||
|
if ( (t->Tag() == TYPE_TABLE && cast_intrusive<TableType>(t)->IsUnspecifiedTable()) ||
|
||||||
(t->Tag() == TYPE_VECTOR && cast_intrusive<VectorType>(t)->IsUnspecifiedVector()) ) {
|
(t->Tag() == TYPE_VECTOR && cast_intrusive<VectorType>(t)->IsUnspecifiedVector()) ) {
|
||||||
init->Error("empty constructor in untyped initialization");
|
init->Error("empty constructor in untyped initialization");
|
||||||
|
|
|
@ -723,16 +723,6 @@ ExprPtr AddExpr::BuildSub(const ExprPtr& op1, const ExprPtr& op2) {
|
||||||
return with_location_of(make_intrusive<SubExpr>(op1, rhs), this);
|
return with_location_of(make_intrusive<SubExpr>(op1, rhs), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprPtr AggrAddDelExpr::Reduce(Reducer* c, StmtPtr& red_stmt) {
|
|
||||||
if ( c->Optimizing() ) {
|
|
||||||
op = c->OptExpr(op);
|
|
||||||
return ThisPtr();
|
|
||||||
}
|
|
||||||
|
|
||||||
red_stmt = op->ReduceToSingletons(c);
|
|
||||||
return ThisPtr();
|
|
||||||
}
|
|
||||||
|
|
||||||
ExprPtr AggrAddExpr::Duplicate() { return SetSucc(new AggrAddExpr(op->Duplicate())); }
|
ExprPtr AggrAddExpr::Duplicate() { return SetSucc(new AggrAddExpr(op->Duplicate())); }
|
||||||
|
|
||||||
ExprPtr AggrDelExpr::Duplicate() { return SetSucc(new AggrDelExpr(op->Duplicate())); }
|
ExprPtr AggrDelExpr::Duplicate() { return SetSucc(new AggrDelExpr(op->Duplicate())); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue