Merge remote-tracking branch 'origin/topic/vern/script-opt-uncompilable-AST'

* origin/topic/vern/script-opt-uncompilable-AST:
  ScriptOpt: Fail compilation if known exprs/stmts is outdated
  skip optimization of functions with AST nodes unknown to script optimization
This commit is contained in:
Arne Welzel 2024-12-09 14:03:29 +01:00
commit 0ebcd9608f
9 changed files with 170 additions and 10 deletions

View file

@ -10,6 +10,7 @@
#include "zeek/script_opt/ProfileFunc.h"
#include "zeek/script_opt/ScriptOpt.h"
#include "zeek/script_opt/StmtOptInfo.h"
#include "zeek/script_opt/ZAM/Support.h"
namespace zeek::detail {
@ -160,7 +161,7 @@ void Inliner::Analyze() {
if ( non_recursive_funcs.count(func) == 0 )
continue;
if ( body->Tag() == STMT_CPP )
if ( ! is_ZAM_compilable(f.Profile()) )
continue;
inline_ables[func] = f.Profile();