mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
fixes for a number of ZAM optimization bugs
This commit is contained in:
parent
9bfe18473d
commit
1dc74eaa9c
11 changed files with 44 additions and 28 deletions
|
@ -171,7 +171,7 @@ void IfStmt::Inline(Inliner* inl) {
|
|||
}
|
||||
|
||||
bool IfStmt::IsReduced(Reducer* c) const {
|
||||
if ( ! e->IsReducedConditional(c) )
|
||||
if ( e->IsConst() || ! e->IsReducedConditional(c) )
|
||||
return NonReduced(e.get());
|
||||
|
||||
return s1->IsReduced(c) && s2->IsReduced(c);
|
||||
|
@ -707,7 +707,7 @@ bool StmtList::ReduceStmt(unsigned int& s_i, std::vector<StmtPtr>& f_stmts, Redu
|
|||
|
||||
if ( e->Tag() != EXPR_ASSIGN ) {
|
||||
f_stmts.push_back(std::move(stmt));
|
||||
return false;
|
||||
return did_change;
|
||||
}
|
||||
|
||||
auto a = e->AsAssignExpr();
|
||||
|
@ -715,7 +715,7 @@ bool StmtList::ReduceStmt(unsigned int& s_i, std::vector<StmtPtr>& f_stmts, Redu
|
|||
|
||||
if ( lhs->Tag() != EXPR_NAME ) {
|
||||
f_stmts.push_back(std::move(stmt));
|
||||
return false;
|
||||
return did_change;
|
||||
}
|
||||
|
||||
auto var = lhs->AsNameExpr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue