mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18: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:
|
||||
bool IsReduced(Reducer* c) const override { return 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 {
|
||||
|
|
|
@ -2537,6 +2537,11 @@ TypePtr init_type(const detail::ExprPtr& init) {
|
|||
if ( init->Tag() != detail::EXPR_LIST ) {
|
||||
auto t = init->InitType();
|
||||
|
||||
if ( ! t ) {
|
||||
init->Error("not a valid initializer");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if ( (t->Tag() == TYPE_TABLE && cast_intrusive<TableType>(t)->IsUnspecifiedTable()) ||
|
||||
(t->Tag() == TYPE_VECTOR && cast_intrusive<VectorType>(t)->IsUnspecifiedVector()) ) {
|
||||
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);
|
||||
}
|
||||
|
||||
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 AggrDelExpr::Duplicate() { return SetSucc(new AggrDelExpr(op->Duplicate())); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue