mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
skip ZAM optimization of invalid scripts
This commit is contained in:
parent
3a99e60d1c
commit
b16195d130
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include "zeek/Desc.h"
|
#include "zeek/Desc.h"
|
||||||
#include "zeek/Reporter.h"
|
#include "zeek/Reporter.h"
|
||||||
|
#include "zeek/ScriptValidation.h"
|
||||||
#include "zeek/ZeekString.h"
|
#include "zeek/ZeekString.h"
|
||||||
#include "zeek/script_opt/ProfileFunc.h"
|
#include "zeek/script_opt/ProfileFunc.h"
|
||||||
|
|
||||||
|
@ -33,6 +34,14 @@ bool is_ZAM_compilable(const ProfileFunc* pf, const char** reason)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto b = pf->ProfiledBody();
|
||||||
|
if ( b && ! script_is_valid(b) )
|
||||||
|
{
|
||||||
|
if ( reason )
|
||||||
|
*reason = "invalid script body";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue