diff --git a/CHANGES b/CHANGES index 15d418df6d..cdadc67fde 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,22 @@ +8.0.0-dev.622 | 2025-07-09 15:10:03 -0700 + + * ZAM optimizer fix for += / -= set operations (Vern Paxson, Corelight) + + * Bump `spicy-format` pre-commit hook (Benjamin Bannier, Corelight) + + pre-commit ignores Cargo.lock files for Rust projects, so any movement + in a Rust project's dependencies can break a hook, even if no code in + the hook changed. I have tried to work with upstream on a fix, but they + basically told me they weren't interested and to get lost. + + This bumps the `spicy-format` pre-commit hook to a new version which + explicitly deals with bumps of its dependencies. Having to do this + semi-regularly is not fun, and ideally somebody interested in using this + hook would help set up infrastructure in the hook so it just pulls + pre-built binaries. This is not directly supported by pre-commit, but + many projects work around this by declaring a Python module which then + pulls pre-build binaries which already exist for spicy-format. + 8.0.0-dev.618 | 2025-07-08 17:45:16 -0700 * Clarify the cookie field's origin in the RDP log. (Christian Kreibich, Corelight) diff --git a/VERSION b/VERSION index 284ce4b805..88baf037c2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.0.0-dev.618 +8.0.0-dev.622 diff --git a/src/script_opt/Expr.cc b/src/script_opt/Expr.cc index 159d0107e7..cb2927c6de 100644 --- a/src/script_opt/Expr.cc +++ b/src/script_opt/Expr.cc @@ -767,6 +767,9 @@ bool AddToExpr::IsReduced(Reducer* c) const { } ExprPtr AddToExpr::Reduce(Reducer* c, StmtPtr& red_stmt) { + if ( c->Optimizing() ) + op2 = c->UpdateExpr(op2); + auto tag = op1->GetType()->Tag(); switch ( tag ) { @@ -869,6 +872,9 @@ bool RemoveFromExpr::IsReduced(Reducer* c) const { } ExprPtr RemoveFromExpr::Reduce(Reducer* c, StmtPtr& red_stmt) { + if ( c->Optimizing() ) + op2 = c->UpdateExpr(op2); + if ( op1->GetType()->Tag() == TYPE_TABLE ) { StmtPtr red_stmt1; StmtPtr red_stmt2; diff --git a/testing/btest/Baseline/opt.regress-set-op-opt/output b/testing/btest/Baseline/opt.regress-set-op-opt/output new file mode 100644 index 0000000000..6102e32795 --- /dev/null +++ b/testing/btest/Baseline/opt.regress-set-op-opt/output @@ -0,0 +1,4 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +[my_set={ + +}] diff --git a/testing/btest/opt/regress-set-op-opt.zeek b/testing/btest/opt/regress-set-op-opt.zeek new file mode 100644 index 0000000000..8e11e0725c --- /dev/null +++ b/testing/btest/opt/regress-set-op-opt.zeek @@ -0,0 +1,20 @@ +# @TEST-DOC: Regression test for ZAM optimizer mis-transforming set +=/-= ops +# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1" +# @TEST-EXEC: zeek -b -O ZAM %INPUT >output +# @TEST-EXEC: btest-diff output + +type R: record { + my_set: set[string]; +}; + +event zeek_init() + { + local r1 = R(); + local r2 = R(); + + if ( |r1$my_set| > 0 ) + print T; + + r2$my_set += r1$my_set; + print r2; + }