mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
updates to ZAM to track recent changes in script semantics
This commit is contained in:
parent
e7412e257f
commit
3f9f47980a
7 changed files with 38 additions and 2588 deletions
|
@ -941,6 +941,12 @@ TraversalCode CSE_ValidityChecker::PreExpr(const Expr* e)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EXPR_TABLE_CONSTRUCTOR:
|
||||||
|
// These have EXPR_ASSIGN's in them that don't
|
||||||
|
// correspond to actual assignments to variables,
|
||||||
|
// so we don't want to traverse them.
|
||||||
|
return TC_ABORTSTMT;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ( in_aggr_mod_stmt && (t == EXPR_INDEX || t == EXPR_FIELD) )
|
if ( in_aggr_mod_stmt && (t == EXPR_INDEX || t == EXPR_FIELD) )
|
||||||
{
|
{
|
||||||
|
|
|
@ -230,7 +230,8 @@ const ZAMStmt ZAMCompiler::CompileAssignToIndex(const NameExpr* lhs, const Index
|
||||||
auto n = const_aggr ? nullptr : aggr->AsNameExpr();
|
auto n = const_aggr ? nullptr : aggr->AsNameExpr();
|
||||||
auto con = const_aggr ? aggr->AsConstExpr() : nullptr;
|
auto con = const_aggr ? aggr->AsConstExpr() : nullptr;
|
||||||
|
|
||||||
if ( indexes.length() == 1 && indexes[0]->GetType()->Tag() == TYPE_VECTOR )
|
if ( indexes.length() == 1 && indexes[0]->GetType()->Tag() == TYPE_VECTOR &&
|
||||||
|
aggr->GetType()->Tag() != TYPE_TABLE )
|
||||||
{
|
{
|
||||||
auto index1 = indexes[0];
|
auto index1 = indexes[0];
|
||||||
if ( index1->Tag() == EXPR_CONST )
|
if ( index1->Tag() == EXPR_CONST )
|
||||||
|
|
|
@ -1055,7 +1055,17 @@ macro EvalConstructRecord(map_init, map_accessor)
|
||||||
auto n = aux->n;
|
auto n = aux->n;
|
||||||
map_init
|
map_init
|
||||||
for ( auto i = 0; i < n; ++i )
|
for ( auto i = 0; i < n; ++i )
|
||||||
new_r->Assign(map_accessor, aux->ToVal(frame, i));
|
{
|
||||||
|
auto v_i = aux->ToVal(frame, i);
|
||||||
|
auto ind = map_accessor;
|
||||||
|
if ( v_i && v_i->GetType()->Tag() == TYPE_VECTOR &&
|
||||||
|
v_i->GetType<VectorType>()->IsUnspecifiedVector() )
|
||||||
|
{
|
||||||
|
const auto& t_ind = rt->GetFieldType(ind);
|
||||||
|
v_i->AsVectorVal()->Concretize(t_ind->Yield());
|
||||||
|
}
|
||||||
|
new_r->Assign(ind, aux->ToVal(frame, i));
|
||||||
|
}
|
||||||
auto& r = frame[z.v1].record_val;
|
auto& r = frame[z.v1].record_val;
|
||||||
Unref(r);
|
Unref(r);
|
||||||
r = new_r;
|
r = new_r;
|
||||||
|
@ -2084,9 +2094,17 @@ eval EvalStrStr(frame[z.v2], z.c)
|
||||||
internal-op Analyzer--Name
|
internal-op Analyzer--Name
|
||||||
type VV
|
type VV
|
||||||
eval auto atype = frame[z.v2].ToVal(z.t);
|
eval auto atype = frame[z.v2].ToVal(z.t);
|
||||||
auto& name = analyzer_mgr->GetComponentName(cast_intrusive<EnumVal>(atype));
|
auto val = atype->AsEnumVal();
|
||||||
Unref(frame[z.v1].string_val);
|
Unref(frame[z.v1].string_val);
|
||||||
frame[z.v1].string_val = new StringVal(name);
|
plugin::Component* component = zeek::analyzer_mgr->Lookup(val);
|
||||||
|
if ( ! component )
|
||||||
|
component = zeek::packet_mgr->Lookup(val);
|
||||||
|
if ( ! component )
|
||||||
|
component = zeek::file_mgr->Lookup(val);
|
||||||
|
if ( component )
|
||||||
|
frame[z.v1].string_val = new StringVal(component->CanonicalName());
|
||||||
|
else
|
||||||
|
frame[z.v1].string_val = new StringVal("<error>");
|
||||||
|
|
||||||
internal-op Files--Enable-Reassembly
|
internal-op Files--Enable-Reassembly
|
||||||
op1-read
|
op1-read
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "zeek/broker/Manager.h"
|
#include "zeek/broker/Manager.h"
|
||||||
#include "zeek/file_analysis/Manager.h"
|
#include "zeek/file_analysis/Manager.h"
|
||||||
#include "zeek/logging/Manager.h"
|
#include "zeek/logging/Manager.h"
|
||||||
|
#include "zeek/packet_analysis/Manager.h"
|
||||||
|
|
||||||
namespace zeek::detail
|
namespace zeek::detail
|
||||||
{
|
{
|
||||||
|
|
7
testing/btest/Baseline.zam/bifs.disable_analyzer/out
Normal file
7
testing/btest/Baseline.zam/bifs.disable_analyzer/out
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
|
proto confirm, AllAnalyzers::ANALYZER_ANALYZER_HTTP
|
||||||
|
http_request, GET, /style/enhanced.css
|
||||||
|
T
|
||||||
|
total http messages, {
|
||||||
|
[[orig_h=192.168.1.104, orig_p=1673/tcp, resp_h=63.245.209.11, resp_p=80/tcp]] = 1
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
|
@ -1,3 +1,4 @@
|
||||||
|
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
|
||||||
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo Hooks
|
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Demo Hooks
|
||||||
# @TEST-EXEC: cp -r %DIR/hooks-plugin/* .
|
# @TEST-EXEC: cp -r %DIR/hooks-plugin/* .
|
||||||
# @TEST-EXEC: ./configure --zeek-dist=${DIST} && make
|
# @TEST-EXEC: ./configure --zeek-dist=${DIST} && make
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue