ZAM maintenance for recent changes and some newly exercised corner cases

This commit is contained in:
Vern Paxson 2022-05-01 14:33:58 -07:00
parent aa5a5b2136
commit 7a9c6c476e
6 changed files with 33 additions and 17 deletions

View file

@ -2175,8 +2175,7 @@ ExprPtr ArithCoerceExpr::Reduce(Reducer* c, StmtPtr& red_stmt)
red_stmt = nullptr;
if ( ! op->IsReduced(c) )
op = op->ReduceToSingleton(c, red_stmt);
op = op->ReduceToSingleton(c, red_stmt);
if ( op->Tag() == EXPR_CONST )
{

View file

@ -800,6 +800,16 @@ void ZAMCompiler::CheckSlotUse(int slot, const ZInstI* inst)
void ZAMCompiler::ExtendLifetime(int slot, const ZInstI* inst)
{
// When using old-style lambda closure semantics, a function that
// returns a lambda needs to stick around for calls to that lambda.
// We ensure that by extending its lifetime to the end of this
// function.
auto id = frame_denizens[slot];
auto& t = id->GetType();
if ( t->Tag() == TYPE_FUNC && t->Yield() && t->Yield()->Tag() == TYPE_FUNC )
inst = insts1.back();
if ( denizen_ending.count(slot) > 0 )
{
// End of denizen's lifetime already seen. Check for

View file

@ -1,11 +1,14 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
| Hook Some Info <...>/reporter-hook.zeek, line 16
| Hook error An Error <...>/reporter-hook.zeek, line 18
| Hook error An Error that does not show up in the log <...>/reporter-hook.zeek, line 19
| Hook runtime error field value missing: $a <...>/reporter-hook.zeek, line 23
| Hook warning A warning <...>/reporter-hook.zeek, line 17
<...>/reporter-hook.zeek, line 16: Some Info
error in <...>/reporter-hook.zeek, line 18: An Error
error in <...>/reporter-hook.zeek, line 19: An Error that does not show up in the log
runtime error in <...>/reporter-hook.zeek, line 23: field value missing: $a
warning in <...>/reporter-hook.zeek, line 17: A warning
Reporter::Hook - Exercise Reporter Hook (dynamic, version 1.0.0)
Implements Reporter (priority 0)
| Hook Some Info <...>/reporter-hook.zeek, line 17
| Hook error An Error <...>/reporter-hook.zeek, line 19
| Hook error An Error that does not show up in the log <...>/reporter-hook.zeek, line 20
| Hook runtime error field value missing: $a <...>/reporter-hook.zeek, line 24
| Hook warning A warning <...>/reporter-hook.zeek, line 18
<...>/reporter-hook.zeek, line 17: Some Info
error in <...>/reporter-hook.zeek, line 19: An Error
error in <...>/reporter-hook.zeek, line 20: An Error that does not show up in the log
runtime error in <...>/reporter-hook.zeek, line 24: field value missing: $a
warning in <...>/reporter-hook.zeek, line 18: A warning

View file

@ -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 <...>/reporter-hook.zeek, line 16
XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/reporter-hook.zeek, line 17
XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/reporter-hook.zeek, line 18
XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing: $a <...>/reporter-hook.zeek, line 23
XXXXXXXXXX.XXXXXX Reporter::INFO Some Info <...>/reporter-hook.zeek, line 17
XXXXXXXXXX.XXXXXX Reporter::WARNING A warning <...>/reporter-hook.zeek, line 18
XXXXXXXXXX.XXXXXX Reporter::ERROR An Error <...>/reporter-hook.zeek, line 19
XXXXXXXXXX.XXXXXX Reporter::ERROR field value missing: $a <...>/reporter-hook.zeek, line 24
#close XXXX-XX-XX-XX-XX-XX

View file

@ -1,4 +1,4 @@
# @TEST-EXEC: zeek %INPUT
# @TEST-EXEC: zeek -b %INPUT
# @TEST-DOC: Regression test #2017; no output check, just shouldn't crash
redef table_expire_interval = 0.1sec;

View file

@ -1,3 +1,7 @@
# the scripts and triggers the timeout. Ultimately we need to address this
# by capping the size of inlined functions, since the main delay comes from
# traversing enormous AST function bodies.
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
# @TEST-PORT: BROKER_PORT1
# @TEST-PORT: BROKER_PORT2
# @TEST-PORT: BROKER_PORT3