From ee0a6f6835678c1a6e846ac4216e83bcb8f33ff4 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Tue, 8 Nov 2022 11:56:32 -0800 Subject: [PATCH] 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 --- src/Frame.h | 1 + src/Options.cc | 6 +- src/script_opt/CPP/DeclFunc.cc | 6 +- src/script_opt/CPP/Driver.cc | 43 +++++++++---- src/script_opt/CPP/Exprs.cc | 10 ++- src/script_opt/CPP/Inits.cc | 7 -- src/script_opt/CPP/README.md | 4 +- src/script_opt/CPP/RuntimeOps.h | 2 + src/script_opt/CPP/Stmts.cc | 17 +++-- src/script_opt/CPP/Util.cc | 5 +- src/script_opt/CPP/maint/README | 10 +-- src/script_opt/Inline.cc | 5 ++ src/script_opt/ScriptOpt.cc | 5 ++ src/script_opt/ScriptOpt.h | 4 ++ src/script_opt/Stmt.cc | 9 ++- src/script_opt/ZAM/AM-Opt.cc | 19 +++++- src/script_opt/ZAM/IterInfo.h | 9 ++- src/script_opt/ZAM/Ops.in | 64 +++++++++++++------ src/script_opt/ZAM/Stmt.cc | 51 +++++++++++---- src/script_opt/ZAM/ZInst.h | 6 +- .../Baseline.cpp/bifs.records_fields/out | 58 ----------------- .../broker.store.create-failure/zeek.err | 4 +- .../core.reporter/logger-test.log | 6 +- .../btest/Baseline.cpp/core.reporter/output | 6 +- .../coverage.basic-no-errors/.stderr | 2 +- .../coverage.basic-no-errors/reporter.log | 2 +- .../language.index-assignment-invalid/out | 2 +- .../Baseline.cpp/plugins.reporter-hook/output | 16 ++--- .../plugins.reporter-hook/reporter.log | 6 +- .../bifs.cat_sep_errors-2/.stderr | 2 + .../bifs.cat_sep_errors-3/.stderr | 2 + .../bifs.cat_sep_errors-4/.stderr | 2 + .../bifs.cat_sep_errors-5/.stderr | 2 + .../Baseline.zam/bifs.cat_sep_errors/.stderr | 2 + .../core.event-groups.errors-2/output | 3 + .../core.event-groups.errors-3/output | 3 + .../core.event-groups.errors-4/output | 3 + .../core.event-groups.errors/output | 3 + .../.stderr | 2 + .../output | 6 ++ 40 files changed, 257 insertions(+), 158 deletions(-) delete mode 100644 testing/btest/Baseline.cpp/bifs.records_fields/out create mode 100644 testing/btest/Baseline.zam/bifs.cat_sep_errors-2/.stderr create mode 100644 testing/btest/Baseline.zam/bifs.cat_sep_errors-3/.stderr create mode 100644 testing/btest/Baseline.zam/bifs.cat_sep_errors-4/.stderr create mode 100644 testing/btest/Baseline.zam/bifs.cat_sep_errors-5/.stderr create mode 100644 testing/btest/Baseline.zam/bifs.cat_sep_errors/.stderr create mode 100644 testing/btest/Baseline.zam/core.event-groups.errors-2/output create mode 100644 testing/btest/Baseline.zam/core.event-groups.errors-3/output create mode 100644 testing/btest/Baseline.zam/core.event-groups.errors-4/output create mode 100644 testing/btest/Baseline.zam/core.event-groups.errors/output create mode 100644 testing/btest/Baseline.zam/language.any-script-func-variadic-errors/.stderr create mode 100644 testing/btest/Baseline.zam/language.any-script-func-variadic-errors/output diff --git a/src/Frame.h b/src/Frame.h index b56f547680..76d6892b62 100644 --- a/src/Frame.h +++ b/src/Frame.h @@ -194,6 +194,7 @@ public: call = arg_call; SetTriggerAssoc((void*)call); } + void SetOnlyCall(const CallExpr* arg_call) { call = arg_call; } const CallExpr* GetCall() const { return call; } void SetTriggerAssoc(const void* arg_assoc) { assoc = arg_assoc; } diff --git a/src/Options.cc b/src/Options.cc index 98f251b19a..c978bd31d5 100644 --- a/src/Options.cc +++ b/src/Options.cc @@ -206,13 +206,15 @@ static void print_analysis_help() fprintf(stderr, "\n--optimize options when generating C++:\n"); fprintf(stderr, " add-C++ add C++ script bodies to existing generated code\n"); + fprintf( + stderr, + " allow-cond allow standalone compilation of functions influenced by conditionals\n"); fprintf(stderr, " gen-C++ generate C++ script bodies\n"); fprintf(stderr, " gen-standalone-C++ generate \"standalone\" C++ script bodies\n"); fprintf(stderr, " help print this list\n"); fprintf(stderr, " report-C++ report available C++ script bodies and exit\n"); fprintf(stderr, " report-uncompilable print names of functions that can't be compiled\n"); fprintf(stderr, " use-C++ use available C++ script bodies\n"); - fprintf(stderr, "\n experimental options for incremental compilation:\n"); } static void set_analysis_option(const char* opt, Options& opts) @@ -240,6 +242,8 @@ static void set_analysis_option(const char* opt, Options& opts) a_o.activate = a_o.dump_ZAM = true; else if ( util::streq(opt, "add-C++") ) a_o.add_CPP = true; + else if ( util::streq(opt, "allow-cond") ) + a_o.allow_cond = true; else if ( util::streq(opt, "gen-C++") ) a_o.gen_CPP = true; else if ( util::streq(opt, "gen-standalone-C++") ) diff --git a/src/script_opt/CPP/DeclFunc.cc b/src/script_opt/CPP/DeclFunc.cc index cd884bf62c..c66d4f3462 100644 --- a/src/script_opt/CPP/DeclFunc.cc +++ b/src/script_opt/CPP/DeclFunc.cc @@ -101,13 +101,9 @@ void CPPCompile::CreateFunction(const FuncTypePtr& ft, const ProfileFunc* pf, co compiled_funcs.emplace(fname); } - auto h = pf->HashVal(); - - body_hashes[fname] = h; + body_hashes[fname] = pf->HashVal(); body_priorities[fname] = priority; body_names.emplace(body.get(), fname); - - total_hash = merge_p_hashes(total_hash, h); } void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, const string& fname, diff --git a/src/script_opt/CPP/Driver.cc b/src/script_opt/CPP/Driver.cc index ba1b434822..f64c192367 100644 --- a/src/script_opt/CPP/Driver.cc +++ b/src/script_opt/CPP/Driver.cc @@ -73,9 +73,8 @@ void CPPCompile::Compile(bool report_uncompilable) working_dir = buf; - GenProlog(); - unordered_set filenames_reported_as_skipped; + bool had_to_skip = false; // Determine which functions we can call directly, and reuse // previously compiled instances of those if present. @@ -84,11 +83,19 @@ void CPPCompile::Compile(bool report_uncompilable) const auto& f = func.Func(); auto& ofiles = analysis_options.only_files; + auto allow_cond = analysis_options.allow_cond; + string fn = func.Body()->GetLocationInfo()->filename; - if ( ! func.ShouldSkip() && ! ofiles.empty() && files_with_conditionals.count(fn) > 0 ) + if ( ! allow_cond && ! func.ShouldSkip() && ! ofiles.empty() && + files_with_conditionals.count(fn) > 0 ) { - if ( filenames_reported_as_skipped.count(fn) == 0 ) + if ( report_uncompilable ) + reporter->Warning( + "%s cannot be compiled to C++ due to source file %s having conditional code", + f->Name(), fn.c_str()); + + else if ( filenames_reported_as_skipped.count(fn) == 0 ) { reporter->Warning( "skipping compilation of files in %s due to presence of conditional code", @@ -96,6 +103,7 @@ void CPPCompile::Compile(bool report_uncompilable) filenames_reported_as_skipped.insert(fn); } + had_to_skip = true; func.SetSkip(true); } @@ -114,17 +122,30 @@ void CPPCompile::Compile(bool report_uncompilable) } else { - if ( reason && standalone ) - reporter->Error("%s cannot be compiled to standalone C++ due to %s", f->Name(), - reason); - - else if ( reason && report_uncompilable ) - fprintf(stderr, "%s cannot be compiled to C++ due to %s\n", f->Name(), reason); + if ( reason && report_uncompilable ) + { + had_to_skip = true; + reporter->Warning("%s cannot be compiled to C++ due to %s", f->Name(), reason); + } not_fully_compilable.insert(f->Name()); } } + if ( standalone && had_to_skip ) + reporter->FatalError( + "aborting standalone compilation to C++ due to having to skip some functions"); + + // Generate a hash unique for this compilation. + for ( const auto& func : funcs ) + if ( ! func.ShouldSkip() ) + total_hash = merge_p_hashes(total_hash, func.Profile()->HashVal()); + + auto t = util::current_time(); + total_hash = merge_p_hashes(total_hash, hash{}(t)); + + GenProlog(); + // Track all of the types we'll be using. for ( const auto& t : pfs.RepTypes() ) { @@ -213,7 +234,7 @@ void CPPCompile::GenProlog() Emit("#include \"zeek/script_opt/CPP/Runtime.h\"\n"); Emit("namespace zeek::detail { //\n"); - Emit("namespace CPP_%s { // %s\n", Fmt(addl_tag), working_dir); + Emit("namespace CPP_%s { // %s\n", Fmt(total_hash), working_dir); // The following might-or-might-not wind up being populated/used. Emit("std::vector field_mapping;"); diff --git a/src/script_opt/CPP/Exprs.cc b/src/script_opt/CPP/Exprs.cc index f8336b9365..3b0c4aa436 100644 --- a/src/script_opt/CPP/Exprs.cc +++ b/src/script_opt/CPP/Exprs.cc @@ -305,11 +305,13 @@ string CPPCompile::GenCallExpr(const CallExpr* c, GenType gt) auto f_id = f->AsNameExpr()->Id(); const auto& params = f_id->GetType()->AsFuncType()->Params(); auto id_name = f_id->Name(); + auto nargs = args_l->Exprs().length(); bool is_compiled = compiled_simple_funcs.count(id_name) > 0; bool was_compiled = hashed_funcs.count(id_name) > 0; + bool is_variadic = params->NumFields() == 1 && nargs != 1; - if ( ! is_async && (is_compiled || was_compiled) ) + if ( ! is_async && ! is_variadic && (is_compiled || was_compiled) ) { // Can call directly. string fname; @@ -318,7 +320,7 @@ string CPPCompile::GenCallExpr(const CallExpr* c, GenType gt) else fname = compiled_simple_funcs[id_name]; - if ( args_l->Exprs().length() > 0 ) + if ( nargs > 0 ) gen = fname + "(" + GenArgs(params, args_l) + ", f__CPP)"; else gen = fname + "(f__CPP)"; @@ -1097,6 +1099,10 @@ string CPPCompile::GenDirectAssign(const ExprPtr& lhs, const string& rhs_native, const string& rhs_val_ptr, GenType gt, bool top_level) { auto n = lhs->AsNameExpr()->Id(); + + if ( n->IsBlank() ) + return rhs_native; + auto name = IDNameStr(n); string gen; diff --git a/src/script_opt/CPP/Inits.cc b/src/script_opt/CPP/Inits.cc index e18205d02b..d77bd2f5e8 100644 --- a/src/script_opt/CPP/Inits.cc +++ b/src/script_opt/CPP/Inits.cc @@ -338,14 +338,7 @@ void CPPCompile::GenStandaloneActivation() void CPPCompile::GenLoad() { - // First, generate a hash unique to this compilation. - auto t = util::current_time(); - auto th = hash{}(t); - - total_hash = merge_p_hashes(total_hash, th); - Emit("register_scripts__CPP(%s, standalone_init__CPP);", Fmt(total_hash)); - printf("global init_CPP_%llu = load_CPP(%llu);\n", total_hash, total_hash); } diff --git a/src/script_opt/CPP/README.md b/src/script_opt/CPP/README.md index 9f8d8645cd..ddfd0ae28e 100644 --- a/src/script_opt/CPP/README.md +++ b/src/script_opt/CPP/README.md @@ -162,7 +162,7 @@ about associated expressions/statements, making them hard to puzzle out. This could be fixed, but would add execution overhead in passing around the necessary strings / `Location` objects. -* To avoid subtle bugs, the compiler will refrain from compiling script elements (functions, hooks, event handlers) that include conditional code. In addition, when using `--optimize-files` it will not compile any functions appearing in a source file that includes conditional code (even if it's not in a function body). +* To avoid subtle bugs, the compiler will refrain from compiling script elements (functions, hooks, event handlers) that include conditional code. In addition, when using `--optimize-files` it will not compile any functions appearing in a source file that includes conditional code (even if it's not in a function body). You can override this refusal with `-O allow-cond`. * Code compiled with `-O gen-standalone-C++` will not execute any global statements when invoked using the "stand-in" script. The right fix for @@ -170,7 +170,7 @@ this is to shift from encapsulating global statements in a pseudo-function, as currently done, to instead be in a pseudo-event handler. * Code compiled with `-O gen-standalone-C++` likely has bugs if that -code requires initializing a global variable that specifies extend fields in +code requires initializing a global variable that specifies extending fields in an extensible record (i.e., fields added using `redef`). * If a lambda generates an event that is not otherwise referred to, that diff --git a/src/script_opt/CPP/RuntimeOps.h b/src/script_opt/CPP/RuntimeOps.h index c32773c0fb..bf03ef8c0e 100644 --- a/src/script_opt/CPP/RuntimeOps.h +++ b/src/script_opt/CPP/RuntimeOps.h @@ -4,6 +4,7 @@ #pragma once +#include "zeek/Frame.h" #include "zeek/Val.h" #include "zeek/script_opt/CPP/Func.h" @@ -46,6 +47,7 @@ extern ValPtr when_index_slice__CPP(VectorVal* vec, const ListVal* lv); // but (2) needing to have the address of that vector. inline ValPtr invoke__CPP(Func* f, std::vector args, Frame* frame) { + frame->SetOnlyCall(nullptr); return f->Invoke(&args, frame); } diff --git a/src/script_opt/CPP/Stmts.cc b/src/script_opt/CPP/Stmts.cc index 840b6c79f8..98ccbd2b0c 100644 --- a/src/script_opt/CPP/Stmts.cc +++ b/src/script_opt/CPP/Stmts.cc @@ -499,13 +499,16 @@ void CPPCompile::GenForOverTable(const ExprPtr& tbl, const IDPtr& value_var, Emit("auto* current_tev__CPP = lve__CPP.value;"); Emit("auto ind_lv__CPP = tv__CPP->RecreateIndex(*k__CPP);"); - if ( value_var ) + if ( value_var && ! value_var->IsBlank() ) Emit("%s = %s;", IDName(value_var), GenericValPtrToGT("current_tev__CPP->GetVal()", value_var->GetType(), GEN_NATIVE)); for ( int i = 0; i < loop_vars->length(); ++i ) { auto var = (*loop_vars)[i]; + if ( var->IsBlank() ) + continue; + const auto& v_t = var->GetType(); auto acc = NativeAccessor(v_t); @@ -526,9 +529,12 @@ void CPPCompile::GenForOverVector(const ExprPtr& vec, const IDPtr& value_var, Emit("if ( ! vv__CPP->Has(i__CPP) ) continue;"); - Emit("%s = i__CPP;", IDName((*loop_vars)[0])); + auto lv0 = (*loop_vars)[0]; - if ( value_var ) + if ( ! lv0->IsBlank() ) + Emit("%s = i__CPP;", IDName(lv0)); + + if ( value_var && ! value_var->IsBlank() ) { auto vv = IDName(value_var); auto access = "vv__CPP->ValAt(i__CPP)"; @@ -545,7 +551,10 @@ void CPPCompile::GenForOverString(const ExprPtr& str, const IDPList* loop_vars) StartBlock(); Emit("auto sv__CPP = make_intrusive(1, (const char*) sval__CPP->Bytes() + i__CPP);"); - Emit("%s = std::move(sv__CPP);", IDName((*loop_vars)[0])); + + auto lv0 = (*loop_vars)[0]; + if ( ! lv0->IsBlank() ) + Emit("%s = std::move(sv__CPP);", IDName(lv0)); } } // zeek::detail diff --git a/src/script_opt/CPP/Util.cc b/src/script_opt/CPP/Util.cc index dad23c8704..f8a2b0809d 100644 --- a/src/script_opt/CPP/Util.cc +++ b/src/script_opt/CPP/Util.cc @@ -28,7 +28,7 @@ string Fmt(double d) string scope_prefix(const string& scope) { - return string("zeek::detail::CPP_") + scope + "::"; + return "zeek::detail::CPP_" + scope; } string scope_prefix(int scope) @@ -38,6 +38,9 @@ string scope_prefix(int scope) bool is_CPP_compilable(const ProfileFunc* pf, const char** reason) { + if ( analysis_options.allow_cond ) + return true; + auto body = pf->ProfiledBody(); if ( body && ! body->GetOptInfo()->is_free_of_conditionals ) { diff --git a/src/script_opt/CPP/maint/README b/src/script_opt/CPP/maint/README index 076d1e5b63..50b840f325 100644 --- a/src/script_opt/CPP/maint/README +++ b/src/script_opt/CPP/maint/README @@ -15,7 +15,7 @@ The maintenance workflow: to check in updates to the list of how the compiler currently fares on various btests (see end of this doc): - Wed Oct 12 11:36:46 PDT 2022 + Mon Nov 7 14:30:51 PST 2022 2. Run "find-test-files.sh" to generate a list (to stdout) of all of the possible Zeek source files found in the test suite. @@ -62,23 +62,19 @@ These BTests won't successfully run due to the indicated issue: bad-constructor - uses a complex old-style constructor that should be updated bad-when - deliberately has old-style "when" without captures + cond - not compilable due to the presence of conditional code deprecated - uses deprecated features not support for -O gen-C++ test-glitch - fails because of how we do testing: the first -O gen-C++ pass leaves httpd running, which causes the second -O use-C++ pass to fail when it tries to start up a new httpd - opaque - needs a global whose value is (or contains) an opaque value, - not currently supported skipped - test can be skipped due to environmental reasons (e.g., whether we have a certain Kerberos setup) Database Of Known Issues (keep sorted) ../testing/btest/bifs/table_values.zeek bad-constructor -../testing/btest/language/alternate-event-hook-prototypes.zeek deprecated -../testing/btest/language/redef-same-prefixtable-idx.zeek deprecated -../testing/btest/language/table-redef.zeek deprecated -../testing/btest/language/when-aggregates.zeek bad-when ../testing/btest/scripts/base/protocols/krb/smb2_krb.test skipped ../testing/btest/scripts/base/protocols/krb/smb2_krb_nokeytab.test skipped ../testing/btest/scripts/base/utils/active-http.test test-glitch +../testing/btest/scripts/policy/frameworks/dpd/packet-segment-logging.zeek cond ../testing/btest/scripts/policy/misc/dump-events.zeek skipped diff --git a/src/script_opt/Inline.cc b/src/script_opt/Inline.cc index cc2ed52100..311b771823 100644 --- a/src/script_opt/Inline.cc +++ b/src/script_opt/Inline.cc @@ -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(function); if ( inline_ables.count(func_vf) == 0 ) diff --git a/src/script_opt/ScriptOpt.cc b/src/script_opt/ScriptOpt.cc index a29ca2b79a..fc4096e4ea 100644 --- a/src/script_opt/ScriptOpt.cc +++ b/src/script_opt/ScriptOpt.cc @@ -278,6 +278,7 @@ static void init_options() check_env_opt("ZEEK_COMPILE_ALL", analysis_options.compile_all); check_env_opt("ZEEK_REPORT_CPP", analysis_options.report_CPP); check_env_opt("ZEEK_USE_CPP", analysis_options.use_CPP); + check_env_opt("ZEEK_ALLOW_COND", analysis_options.allow_cond); if ( analysis_options.gen_standalone_CPP || analysis_options.add_CPP ) analysis_options.gen_CPP = true; @@ -288,6 +289,10 @@ static void init_options() if ( analysis_options.use_CPP && generating_CPP ) reporter->FatalError("generating C++ incompatible with using C++"); + if ( analysis_options.allow_cond && ! analysis_options.gen_standalone_CPP ) + reporter->FatalError( + "\"-O allow-cond\" only relevant when also using \"-O gen-standalone-C++\""); + auto usage = getenv("ZEEK_USAGE_ISSUES"); if ( usage ) diff --git a/src/script_opt/ScriptOpt.h b/src/script_opt/ScriptOpt.h index 68986cb7a2..d6aff9d9dc 100644 --- a/src/script_opt/ScriptOpt.h +++ b/src/script_opt/ScriptOpt.h @@ -110,6 +110,10 @@ struct AnalyOpt // If true, report on available C++ bodies. bool report_CPP = false; + + // If true, allow standalone compilation in the presence of + // conditional code. + bool allow_cond = false; }; extern AnalyOpt analysis_options; diff --git a/src/script_opt/Stmt.cc b/src/script_opt/Stmt.cc index 2e01d66002..40966763db 100644 --- a/src/script_opt/Stmt.cc +++ b/src/script_opt/Stmt.cc @@ -600,7 +600,7 @@ bool ForStmt::IsReduced(Reducer* c) const if ( ! c->IDsAreReduced(loop_vars) ) return false; - if ( value_var && ! c->ID_IsReduced(value_var) ) + if ( value_var && (value_var->IsBlank() || ! c->ID_IsReduced(value_var)) ) return false; return body->IsReduced(c); @@ -608,6 +608,13 @@ bool ForStmt::IsReduced(Reducer* c) const StmtPtr ForStmt::DoReduce(Reducer* c) { + if ( value_var && value_var->IsBlank() ) + { + auto no_vv = make_intrusive(loop_vars, e); + no_vv->AddBody(body); + return TransformMe(no_vv, c); + } + StmtPtr red_e_stmt; if ( c->Optimizing() ) diff --git a/src/script_opt/ZAM/AM-Opt.cc b/src/script_opt/ZAM/AM-Opt.cc index ef13bef0c8..7735167fc4 100644 --- a/src/script_opt/ZAM/AM-Opt.cc +++ b/src/script_opt/ZAM/AM-Opt.cc @@ -368,6 +368,10 @@ void ZAMCompiler::ComputeFrameLifetimes() for ( auto v : iter_vars ) { + if ( v < 0 ) + // This happens for '_' dummy + continue; + CheckSlotAssignment(v, inst); // Also mark it as usage throughout the @@ -410,6 +414,13 @@ void ZAMCompiler::ComputeFrameLifetimes() } break; + case OP_NEXT_VECTOR_BLANK_ITER_VAL_VAR_VVV: + { + auto depth = inst->loop_depth; + ExtendLifetime(inst->v1, EndOfLoop(inst, depth)); + } + break; + case OP_NEXT_VECTOR_ITER_VVV: case OP_NEXT_STRING_ITER_VVV: // Sometimes loops are written that don't actually @@ -423,6 +434,10 @@ void ZAMCompiler::ComputeFrameLifetimes() ExtendLifetime(inst->v1, EndOfLoop(inst, inst->loop_depth)); break; + case OP_NEXT_VECTOR_BLANK_ITER_VV: + case OP_NEXT_STRING_BLANK_ITER_VV: + break; + case OP_INIT_TABLE_LOOP_VV: case OP_INIT_VECTOR_LOOP_VV: case OP_INIT_STRING_LOOP_VV: @@ -573,7 +588,9 @@ void ZAMCompiler::ReMapFrame() auto& iter_vars = inst->aux->loop_vars; for ( auto& v : iter_vars ) { - ASSERT(v >= 0 && v < n1_slots); + if ( v < 0 ) + continue; + ASSERT(v < n1_slots); v = frame1_to_frame2[v]; } } diff --git a/src/script_opt/ZAM/IterInfo.h b/src/script_opt/ZAM/IterInfo.h index d94d1f4883..db9222d0b2 100644 --- a/src/script_opt/ZAM/IterInfo.h +++ b/src/script_opt/ZAM/IterInfo.h @@ -52,10 +52,13 @@ public: for ( int i = 0; i < ind_lv->Length(); ++i ) { ValPtr ind_lv_p = ind_lv->Idx(i); - auto& var = frame[aux->loop_vars[i]]; - auto& t = aux->loop_var_types[i]; - if ( ZVal::IsManagedType(t) ) + auto lv = aux->loop_vars[i]; + if ( lv < 0 ) + continue; + auto& var = frame[lv]; + if ( aux->lvt_is_managed[i] ) ZVal::DeleteManagedType(var); + auto& t = aux->loop_var_types[i]; var = ZVal(ind_lv_p, t); } diff --git a/src/script_opt/ZAM/Ops.in b/src/script_opt/ZAM/Ops.in index f07328b524..770766bf59 100644 --- a/src/script_opt/ZAM/Ops.in +++ b/src/script_opt/ZAM/Ops.in @@ -1743,24 +1743,35 @@ op1-read eval auto& vv = frame[z.v1].vector_val->RawVec(); step_iters[z.v2].InitLoop(vv); +macro NextVectorIterCore(info, branch) + auto& si = step_iters[info]; + if ( si.IsDoneIterating() ) + BRANCH(branch) + const auto& vv = *si.vv; + if ( ! vv[si.iter] ) + { /* Account for vector hole. Re-execute for next position. */ + si.IterFinished(); + --pc; /* so we then increment to here again */ + break; + } + internal-op Next-Vector-Iter # v1 = iteration variable # v2 = iteration info # v3 = branch target if loop done type VVV -eval auto& si = step_iters[z.v2]; - if ( si.IsDoneIterating() ) - BRANCH(v3) - const auto& vv = *si.vv; - if ( ! vv[si.iter] ) - { // Account for vector hole. Re-execute for next position. - si.IterFinished(); - --pc; // so we then increment to here again - break; - } +eval NextVectorIterCore(z.v2, v3) frame[z.v1].uint_val = si.iter; si.IterFinished(); +internal-op Next-Vector-Blank-Iter +# v1 = iteration info +# v2 = branch target if loop done +op1-internal +type VV +eval NextVectorIterCore(z.v1, v2) + si.IterFinished(); + internal-op Next-Vector-Iter-Val-Var # v1 = iteration variable # v2 = value variable @@ -1768,16 +1779,7 @@ internal-op Next-Vector-Iter-Val-Var # v4 = branch target if loop done op1-read-write type VVVV -eval auto& si = step_iters[z.v3]; - if ( si.IsDoneIterating() ) - BRANCH(v4) - const auto& vv = *si.vv; - if ( ! vv[si.iter] ) - { // Account for vector hole. Re-execute for next position. - si.IterFinished(); - --pc; // so we then increment to here again - break; - } +eval NextVectorIterCore(z.v3, v4) frame[z.v1].uint_val = si.iter; if ( z.is_managed ) frame[z.v2] = BuildVal(vv[si.iter]->ToVal(z.t), z.t); @@ -1785,6 +1787,18 @@ eval auto& si = step_iters[z.v3]; frame[z.v2] = *vv[si.iter]; si.IterFinished(); +internal-op Next-Vector-Blank-Iter-Val-Var +# v1 = value variable +# v2 = iteration info +# v3 = branch target if loop done +type VVV +eval NextVectorIterCore(z.v2, v3) + if ( z.is_managed ) + frame[z.v1] = BuildVal(vv[si.iter]->ToVal(z.t), z.t); + else + frame[z.v1] = *vv[si.iter]; + si.IterFinished(); + internal-op Init-String-Loop type VV @@ -1809,6 +1823,16 @@ eval auto& si = step_iters[z.v2]; frame[z.v1].string_val = sv; si.IterFinished(); +internal-op Next-String-Blank-Iter +# v1 = iteration info +# v2 = branch target if loop done +op1-internal +type VV +eval auto& si = step_iters[z.v1]; + if ( si.IsDoneIterating() ) + BRANCH(v2) + si.IterFinished(); + internal-op End-Table-Loop op1-internal type V diff --git a/src/script_opt/ZAM/Stmt.cc b/src/script_opt/ZAM/Stmt.cc index 289eec3cfd..2b8b1fbf69 100644 --- a/src/script_opt/ZAM/Stmt.cc +++ b/src/script_opt/ZAM/Stmt.cc @@ -811,11 +811,14 @@ const ZAMStmt ZAMCompiler::LoopOverTable(const ForStmt* f, const NameExpr* val) { auto id = (*loop_vars)[i]; - if ( body_pf.Locals().count(id) == 0 ) + if ( body_pf.Locals().count(id) == 0 || id->IsBlank() ) ++num_unused; - aux->loop_vars.push_back(FrameSlot(id)); - aux->loop_var_types.push_back(id->GetType()); + int slot = id->IsBlank() ? -1 : FrameSlot(id); + aux->loop_vars.push_back(slot); + auto& t = id->GetType(); + aux->loop_var_types.push_back(t); + aux->lvt_is_managed.push_back(ZVal::IsManagedType(t)); } bool no_loop_vars = (num_unused == loop_vars->length()); @@ -874,19 +877,37 @@ const ZAMStmt ZAMCompiler::LoopOverVector(const ForStmt* f, const NameExpr* val) auto init_end = AddInst(z); auto iter_head = StartingBlock(); + int slot = loop_var->IsBlank() ? -1 : FrameSlot(loop_var); + if ( value_var ) { - z = ZInstI(OP_NEXT_VECTOR_ITER_VAL_VAR_VVVV, FrameSlot(loop_var), FrameSlot(value_var), - iter_slot, 0); + if ( slot >= 0 ) + { + z = ZInstI(OP_NEXT_VECTOR_ITER_VAL_VAR_VVVV, slot, FrameSlot(value_var), iter_slot, 0); + z.op_type = OP_VVVV_I3_I4; + } + else + { + z = ZInstI(OP_NEXT_VECTOR_BLANK_ITER_VAL_VAR_VVV, FrameSlot(value_var), iter_slot, 0); + z.op_type = OP_VVV_I2_I3; + } + z.t = value_var->GetType(); z.is_managed = ZVal::IsManagedType(z.t); - z.op_type = OP_VVVV_I3_I4; } else { - z = ZInstI(OP_NEXT_VECTOR_ITER_VVV, FrameSlot(loop_var), iter_slot, 0); - z.op_type = OP_VVV_I2_I3; + if ( slot >= 0 ) + { + z = ZInstI(OP_NEXT_VECTOR_ITER_VVV, slot, iter_slot, 0); + z.op_type = OP_VVV_I2_I3; + } + else + { + z = ZInstI(OP_NEXT_VECTOR_BLANK_ITER_VV, iter_slot, 0); + z.op_type = OP_VV_I1_I2; + } } return FinishLoop(iter_head, z, f->LoopBody(), iter_slot, false); @@ -918,9 +939,17 @@ const ZAMStmt ZAMCompiler::LoopOverString(const ForStmt* f, const Expr* e) auto init_end = AddInst(z); auto iter_head = StartingBlock(); - z = ZInstI(OP_NEXT_STRING_ITER_VVV, FrameSlot(loop_var), iter_slot, 0); - z.is_managed = true; - z.op_type = OP_VVV_I2_I3; + if ( loop_var->IsBlank() ) + { + z = ZInstI(OP_NEXT_STRING_BLANK_ITER_VV, iter_slot, 0); + z.op_type = OP_VV_I1_I2; + } + else + { + z = ZInstI(OP_NEXT_STRING_ITER_VVV, FrameSlot(loop_var), iter_slot, 0); + z.op_type = OP_VVV_I2_I3; + z.is_managed = true; + } return FinishLoop(iter_head, z, f->LoopBody(), iter_slot, false); } diff --git a/src/script_opt/ZAM/ZInst.h b/src/script_opt/ZAM/ZInst.h index a27ba054c2..d661331162 100644 --- a/src/script_opt/ZAM/ZInst.h +++ b/src/script_opt/ZAM/ZInst.h @@ -423,13 +423,15 @@ public: // to map elements in slots/constants/types to record field offsets. std::vector map; - ///// The following three apply to looping over the elements of tables. + ///// The following four apply to looping over the elements of tables. // Frame slots of iteration variables, such as "[v1, v2, v3] in aggr". + // A negative value means "skip assignment". std::vector loop_vars; - // Their types. + // Their types and whether they're managed. std::vector loop_var_types; + std::vector lvt_is_managed; // Type associated with the "value" entry, for "k, value in aggr" // iteration. diff --git a/testing/btest/Baseline.cpp/bifs.records_fields/out b/testing/btest/Baseline.cpp/bifs.records_fields/out deleted file mode 100644 index 663ae3aa29..0000000000 --- a/testing/btest/Baseline.cpp/bifs.records_fields/out +++ /dev/null @@ -1,58 +0,0 @@ -### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -[a=42, b=Foo, c=, d=Bar, e=tt] -{ -[a] = [type_name=count, log=F, value=42, default_val=], -[d] = [type_name=string, log=T, value=Bar, default_val=], -[b] = [type_name=string, log=F, value=Foo, default_val=Foo], -[c] = [type_name=double, log=F, value=, default_val=], -[e] = [type_name=any, log=F, value=tt, default_val=] -} -F -{ -[a] = [type_name=bool, log=F, value=, default_val=], -[d] = [type_name=string, log=T, value=, default_val=], -[b] = [type_name=string, log=F, value=, default_val=Bar], -[m] = [type_name=record myrec, log=F, value=, default_val=], -[c] = [type_name=double, log=F, value=, default_val=] -} -{ -[a] = [type_name=bool, log=F, value=, default_val=], -[d] = [type_name=string, log=T, value=, default_val=], -[b] = [type_name=string, log=F, value=, default_val=Bar], -[m] = [type_name=record myrec, log=F, value=, default_val=], -[c] = [type_name=double, log=F, value=, default_val=] -} -{ -[a] = [type_name=count, log=F, value=42, default_val=], -[d] = [type_name=string, log=T, value=Bar, default_val=], -[b] = [type_name=string, log=F, value=Foo, default_val=Foo], -[c] = [type_name=double, log=F, value=, default_val=], -[e] = [type_name=any, log=F, value=mystring, default_val=] -} -{ - -} -{ -[myfield] = [type_name=bool, log=F, value=, default_val=] -} -{ -[a] = [type_name=bool, log=F, value=, default_val=], -[d] = [type_name=string, log=T, value=, default_val=], -[b] = [type_name=string, log=F, value=, default_val=Bar], -[m] = [type_name=record myrec, log=F, value=, default_val=], -[c] = [type_name=double, log=F, value=, default_val=] -} -{ -[a] = [type_name=count, log=F, value=, default_val=], -[d] = [type_name=string, log=T, value=, default_val=], -[b] = [type_name=string, log=F, value=, default_val=Foo], -[c] = [type_name=double, log=F, value=, default_val=], -[e] = [type_name=any, log=F, value=, default_val=] -} -{ -[a] = [type_name=set[double], log=F, value=, default_val=], -[d] = [type_name=table[double,string] of table[string] of vector of string, log=F, value=, default_val=], -[b] = [type_name=set[double,string], log=F, value=, default_val=], -[c] = [type_name=set[double,record tt], log=F, value=, default_val=], -[e] = [type_name=vector of vector of string, log=F, value=, default_val=] -} diff --git a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err index daa59f5b73..b6881fde25 100644 --- a/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err +++ b/testing/btest/Baseline.cpp/broker.store.create-failure/zeek.err @@ -1,6 +1,6 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -error in <...>/main.zeek, lines 517-518: Failed to attach master store backend_failure: (Option::set_change_handler(Broker::metrics_export_prefixes, to_any_coerceBroker::update_metrics_export_prefixes, (coerce 0 to int))) -error in <...>/main.zeek, lines 517-518: Could not create Broker master store '../fail' (Option::set_change_handler(Broker::metrics_export_prefixes, to_any_coerceBroker::update_metrics_export_prefixes, (coerce 0 to int))) +error: Failed to attach master store backend_failure: +error: Could not create Broker master store '../fail' error in : invalid Broker store handle (broker::store::{}) error in : invalid Broker store handle (broker::store::{}) error in : invalid Broker store handle (broker::store::{}) diff --git a/testing/btest/Baseline.cpp/core.reporter/logger-test.log b/testing/btest/Baseline.cpp/core.reporter/logger-test.log index e3f07da9c0..5af5e97ecc 100644 --- a/testing/btest/Baseline.cpp/core.reporter/logger-test.log +++ b/testing/btest/Baseline.cpp/core.reporter/logger-test.log @@ -1,7 +1,7 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -reporter_info|init test-info|<...>/main.zeek, lines 517-518|XXXXXXXXXX.XXXXXX -reporter_warning|init test-warning|<...>/main.zeek, lines 517-518|XXXXXXXXXX.XXXXXX -reporter_error|init test-error|<...>/main.zeek, lines 517-518|XXXXXXXXXX.XXXXXX +reporter_info|init test-info||XXXXXXXXXX.XXXXXX +reporter_warning|init test-warning||XXXXXXXXXX.XXXXXX +reporter_error|init test-error||XXXXXXXXXX.XXXXXX reporter_info|done test-info||XXXXXXXXXX.XXXXXX reporter_warning|done test-warning||XXXXXXXXXX.XXXXXX reporter_error|done test-error||XXXXXXXXXX.XXXXXX diff --git a/testing/btest/Baseline.cpp/core.reporter/output b/testing/btest/Baseline.cpp/core.reporter/output index c24704d176..5f77582fab 100644 --- a/testing/btest/Baseline.cpp/core.reporter/output +++ b/testing/btest/Baseline.cpp/core.reporter/output @@ -2,9 +2,9 @@ pre test-info warning: pre test-warning error: pre test-error -<...>/main.zeek, lines 517-518: init test-info -warning in <...>/main.zeek, lines 517-518: init test-warning -error in <...>/main.zeek, lines 517-518: init test-error +init test-info +warning: init test-warning +error: init test-error done test-info warning: done test-warning error: done test-error diff --git a/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr b/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr index 3fc212e554..e5f1b47b43 100644 --- a/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr +++ b/testing/btest/Baseline.cpp/coverage.basic-no-errors/.stderr @@ -1,2 +1,2 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. -<...>/pp-alarms.zeek, line 100: Hello, Zeek! +Hello, Zeek! diff --git a/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log b/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log index 049ae04612..4cc2c7f0e9 100644 --- a/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log +++ b/testing/btest/Baseline.cpp/coverage.basic-no-errors/reporter.log @@ -7,5 +7,5 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts level message location #types time enum string string -XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! <...>/pp-alarms.zeek, line 100 +XXXXXXXXXX.XXXXXX Reporter::INFO Hello, Zeek! (empty) #close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out index ecb82e15f0..a661fb648c 100644 --- a/testing/btest/Baseline.cpp/language.index-assignment-invalid/out +++ b/testing/btest/Baseline.cpp/language.index-assignment-invalid/out @@ -1,6 +1,6 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. runtime error in <...>/queue.zeek, line 152: vector index assignment failed for invalid type 'myrec', value: [a=T, b=hi, c=], expression: Queue::ret[Queue::j], call stack: - #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=], top=7, bottom=0, size=0], [hello, goodbye, test]) at <...>/main.zeek:517 + #0 Queue::get_vector([initialized=T, vals={[2] = test,[3] = [a=T, b=hi, c=],[5] = 3,[0] = hello,[6] = jkl;,[4] = asdf,[1] = goodbye}, settings=[max_len=], top=7, bottom=0, size=0], [hello, goodbye, test]) #1 zeek_init() diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/output b/testing/btest/Baseline.cpp/plugins.reporter-hook/output index 194c546fcc..6f5d0c4fb6 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/output +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/output @@ -2,13 +2,13 @@ Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0) Implements Reporter (priority 0) - | Hook Some Info <...>/main.zeek, lines 517-518 - | Hook error An Error <...>/main.zeek, lines 517-518 - | Hook error An Error that does not show up in the log <...>/main.zeek, lines 517-518 + | Hook Some Info + | Hook error An Error + | Hook error An Error that does not show up in the log | Hook runtime error in compiled code field value missing - | Hook warning A warning <...>/main.zeek, lines 517-518 -<...>/main.zeek, lines 517-518: Some Info -error in <...>/main.zeek, lines 517-518: An Error -error in <...>/main.zeek, lines 517-518: An Error that does not show up in the log + | Hook warning A warning +Some Info +error: An Error +error: An Error that does not show up in the log runtime error in compiled code: field value missing -warning in <...>/main.zeek, lines 517-518: A warning +warning: A warning diff --git a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log index 03f3d8bf6c..fefdfc18d6 100644 --- a/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log +++ b/testing/btest/Baseline.cpp/plugins.reporter-hook/reporter.log @@ -7,8 +7,8 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts level message location #types time enum string string -XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/main.zeek, lines 517-518 -XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/main.zeek, lines 517-518 -XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/main.zeek, lines 517-518 +XXXXXXXXXX.XXXXXX Reporter::INFO Some Info (empty) +XXXXXXXXXX.XXXXXX Reporter::WARNING A warning (empty) +XXXXXXXXXX.XXXXXX Reporter::ERROR An Error (empty) XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing (empty) #close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.zam/bifs.cat_sep_errors-2/.stderr b/testing/btest/Baseline.zam/bifs.cat_sep_errors-2/.stderr new file mode 100644 index 0000000000..901f35dbc7 --- /dev/null +++ b/testing/btest/Baseline.zam/bifs.cat_sep_errors-2/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: cat_sep() takes at least 2 arguments, got 1 diff --git a/testing/btest/Baseline.zam/bifs.cat_sep_errors-3/.stderr b/testing/btest/Baseline.zam/bifs.cat_sep_errors-3/.stderr new file mode 100644 index 0000000000..30799e142e --- /dev/null +++ b/testing/btest/Baseline.zam/bifs.cat_sep_errors-3/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: expected type string for default, got count diff --git a/testing/btest/Baseline.zam/bifs.cat_sep_errors-4/.stderr b/testing/btest/Baseline.zam/bifs.cat_sep_errors-4/.stderr new file mode 100644 index 0000000000..c1df9bf9c3 --- /dev/null +++ b/testing/btest/Baseline.zam/bifs.cat_sep_errors-4/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: expected type string for separator, got count diff --git a/testing/btest/Baseline.zam/bifs.cat_sep_errors-5/.stderr b/testing/btest/Baseline.zam/bifs.cat_sep_errors-5/.stderr new file mode 100644 index 0000000000..43e8239c1a --- /dev/null +++ b/testing/btest/Baseline.zam/bifs.cat_sep_errors-5/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: expected type string for separator, got record diff --git a/testing/btest/Baseline.zam/bifs.cat_sep_errors/.stderr b/testing/btest/Baseline.zam/bifs.cat_sep_errors/.stderr new file mode 100644 index 0000000000..89ba2477c6 --- /dev/null +++ b/testing/btest/Baseline.zam/bifs.cat_sep_errors/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: cat_sep() takes at least 2 arguments, got 0 diff --git a/testing/btest/Baseline.zam/core.event-groups.errors-2/output b/testing/btest/Baseline.zam/core.event-groups.errors-2/output new file mode 100644 index 0000000000..6ec085c36f --- /dev/null +++ b/testing/btest/Baseline.zam/core.event-groups.errors-2/output @@ -0,0 +1,3 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: no such event group: my-group +disable non existing event group, F diff --git a/testing/btest/Baseline.zam/core.event-groups.errors-3/output b/testing/btest/Baseline.zam/core.event-groups.errors-3/output new file mode 100644 index 0000000000..a2d6efb683 --- /dev/null +++ b/testing/btest/Baseline.zam/core.event-groups.errors-3/output @@ -0,0 +1,3 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: no such event group: MyModule +enabling non existing module event group, F diff --git a/testing/btest/Baseline.zam/core.event-groups.errors-4/output b/testing/btest/Baseline.zam/core.event-groups.errors-4/output new file mode 100644 index 0000000000..a40f8b7759 --- /dev/null +++ b/testing/btest/Baseline.zam/core.event-groups.errors-4/output @@ -0,0 +1,3 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: no such event group: MyModule +disable non existing module event group, F diff --git a/testing/btest/Baseline.zam/core.event-groups.errors/output b/testing/btest/Baseline.zam/core.event-groups.errors/output new file mode 100644 index 0000000000..24354cae17 --- /dev/null +++ b/testing/btest/Baseline.zam/core.event-groups.errors/output @@ -0,0 +1,3 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +error: no such event group: my-group +enable non existing event group, F diff --git a/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/.stderr b/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/.stderr new file mode 100644 index 0000000000..b00e21dc02 --- /dev/null +++ b/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/.stderr @@ -0,0 +1,2 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +runtime error: too many arguments for function call diff --git a/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/output b/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/output new file mode 100644 index 0000000000..a6822601c7 --- /dev/null +++ b/testing/btest/Baseline.zam/language.any-script-func-variadic-errors/output @@ -0,0 +1,6 @@ +### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +zeek_init() &priority=10 +l=a local x=1 +zeek_init() &priority=-10 +l=a local x=1 +l=a local x=1