diff --git a/CHANGES b/CHANGES index 02517e4a76..1ccac2f193 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +8.1.0-dev.619 | 2025-09-30 20:45:19 +0000 + + * Fix for standalone initializations that require BiFs, and streamlining of standalone BiF-tracking (Vern Paxson, Corelight) + 8.1.0-dev.617 | 2025-09-30 20:12:14 +0000 * fixed bug in logic for including/excluding files for script optimization (Vern Paxson, Corelight) diff --git a/VERSION b/VERSION index 0aeb7f4a21..e6954a7032 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.1.0-dev.617 +8.1.0-dev.619 diff --git a/src/script_opt/CPP/Inits.cc b/src/script_opt/CPP/Inits.cc index e828986beb..920403b3fe 100644 --- a/src/script_opt/CPP/Inits.cc +++ b/src/script_opt/CPP/Inits.cc @@ -322,7 +322,9 @@ void CPPCompile::GenStandaloneActivation() { Emit("void standalone_init__CPP()"); StartBlock(); Emit("init__CPP();"); + Emit("load_BiFs__CPP(); // support initializations that call BiFs ..."); Emit("standalone_activation__CPP();"); + Emit("// ... and later use of BiFs from plugins not initially available"); Emit("standalone_finalizations.push_back(load_BiFs__CPP);"); EndBlock(); } diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index 0bf0d7ff96..02f674793e 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -388,7 +388,10 @@ TraversalCode ProfileFunc::PreExpr(const Expr* e) { auto sf = static_cast(func_vf); script_calls.insert(sf); } - else + + // Track the BiF, though not if we know we're not going to + // compile the call to it. + else if ( obj_matches_opt_files(e) != AnalyzeDecision::SHOULD_NOT ) BiF_globals.insert(func); } else { diff --git a/src/script_opt/ProfileFunc.h b/src/script_opt/ProfileFunc.h index 7b6186eb06..766b8790cd 100644 --- a/src/script_opt/ProfileFunc.h +++ b/src/script_opt/ProfileFunc.h @@ -256,7 +256,8 @@ protected: std::unordered_set script_calls; // Same for BiF's, though for them we record the corresponding global - // rather than the BuiltinFunc*. + // rather than the BuiltinFunc*. In addition, we only track BiFs germane + // to code we're compiling. IDSet BiF_globals; // Script functions appearing in "when" clauses.