fixes for doing "script validation" to check for ZAM compile-ability

This commit is contained in:
Vern Paxson 2023-06-14 17:39:47 -07:00
parent cae5d30c62
commit 2c5b5bb41f
3 changed files with 20 additions and 12 deletions

View file

@ -35,7 +35,8 @@ bool is_ZAM_compilable(const ProfileFunc* pf, const char** reason)
}
auto b = pf->ProfiledBody();
if ( b && ! script_is_valid(b) )
auto is_hook = pf->ProfiledFunc()->Flavor() == FUNC_FLAVOR_HOOK;
if ( b && ! script_is_valid(b, is_hook) )
{
if ( reason )
*reason = "invalid script body";