mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
"-O use-C++" now fails if no C++ bodies wound up being applicable
This commit is contained in:
parent
34b448ee7b
commit
fb6725a9ce
1 changed files with 7 additions and 0 deletions
|
@ -370,6 +370,8 @@ static void use_CPP()
|
||||||
if ( ! CPP_init_hook )
|
if ( ! CPP_init_hook )
|
||||||
reporter->FatalError("no C++ functions available to use");
|
reporter->FatalError("no C++ functions available to use");
|
||||||
|
|
||||||
|
int num_used = 0;
|
||||||
|
|
||||||
for ( auto& f : funcs )
|
for ( auto& f : funcs )
|
||||||
{
|
{
|
||||||
auto hash = f.Profile()->HashVal();
|
auto hash = f.Profile()->HashVal();
|
||||||
|
@ -377,6 +379,8 @@ static void use_CPP()
|
||||||
|
|
||||||
if ( s != compiled_scripts.end() )
|
if ( s != compiled_scripts.end() )
|
||||||
{
|
{
|
||||||
|
++num_used;
|
||||||
|
|
||||||
auto b = s->second.body;
|
auto b = s->second.body;
|
||||||
b->SetHash(hash);
|
b->SetHash(hash);
|
||||||
|
|
||||||
|
@ -407,6 +411,9 @@ static void use_CPP()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( num_used == 0 )
|
||||||
|
reporter->FatalError("no C++ functions found to use");
|
||||||
|
|
||||||
// Now that we've loaded all of the compiled scripts
|
// Now that we've loaded all of the compiled scripts
|
||||||
// relevant for the AST, activate standalone ones.
|
// relevant for the AST, activate standalone ones.
|
||||||
for ( auto cb : standalone_activations )
|
for ( auto cb : standalone_activations )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue