mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
skip optimization of functions with AST nodes unknown to script optimization
This commit is contained in:
parent
a2a47ba334
commit
35e157a0ab
7 changed files with 148 additions and 9 deletions
|
@ -117,6 +117,12 @@ bool file_mgr_set_reassembly_buffer(StringVal* file_id, uint64_t max) {
|
|||
bool ZAM_error = false;
|
||||
|
||||
bool is_ZAM_compilable(const ProfileFunc* pf, const char** reason) {
|
||||
if ( has_AST_node_unknown_to_script_opt(pf, true) ) {
|
||||
if ( reason )
|
||||
*reason = "unknown AST node type";
|
||||
return false;
|
||||
}
|
||||
|
||||
auto b = pf->ProfiledBody();
|
||||
auto is_hook = pf->ProfiledFunc()->Flavor() == FUNC_FLAVOR_HOOK;
|
||||
if ( b && ! script_is_valid(b, is_hook) ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue