Script optimization maintenance and updates:

maintenance fixes for variadic run-time checks, '_' placeholder identifier
  "-O allow-cond" permits compiling scripts to C++ when influenced by @if conditionals
  more robust standalone compile-to-C++ properties
  fix for nested "when" statements
  test suite updates
This commit is contained in:
Vern Paxson 2022-11-08 11:56:32 -08:00
parent bc0284aefa
commit ee0a6f6835
40 changed files with 257 additions and 158 deletions

View file

@ -180,6 +180,11 @@ ExprPtr Inliner::CheckForInlining(CallExprPtr c)
if ( function->GetKind() != Func::SCRIPT_FUNC )
return c;
// Check for mismatches in argument count due to single-arg-of-type-any
// loophole used for variadic BiFs.
if ( function->GetType()->Params()->NumFields() == 1 && c->Args()->Exprs().size() != 1 )
return c;
auto func_vf = static_cast<ScriptFunc*>(function);
if ( inline_ables.count(func_vf) == 0 )