mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Switching vectors from being 1-based to 0-based.
This is obviously a change that break backwards-compatibility. I hope I caught all cases where vectors are used ... I've completely removed the VECTOR_MIN constant. Turns out that was already not working: some code pieces were nevertheless hard-coding the 1-based indexing ...
This commit is contained in:
parent
f564023a12
commit
4aa844aa87
10 changed files with 47 additions and 66 deletions
|
@ -500,7 +500,7 @@ event irc_channel_topic(c: connection, channel: string, topic: string)
|
||||||
local conn = get_conn(c);
|
local conn = get_conn(c);
|
||||||
|
|
||||||
local ch = get_channel(conn, channel);
|
local ch = get_channel(conn, channel);
|
||||||
ch$topic_history[|ch$topic_history| + 1] = ch$topic;
|
ch$topic_history[|ch$topic_history|] = ch$topic;
|
||||||
ch$topic = topic;
|
ch$topic = topic;
|
||||||
|
|
||||||
if ( c$id in bot_conns )
|
if ( c$id in bot_conns )
|
||||||
|
|
|
@ -295,8 +295,8 @@ function pm_mapping_to_text(server: addr, m: pm_mappings): string
|
||||||
if ( [prog, p] !in mapping_seen )
|
if ( [prog, p] !in mapping_seen )
|
||||||
{
|
{
|
||||||
add mapping_seen[prog, p];
|
add mapping_seen[prog, p];
|
||||||
addls[++num_addls] = fmt("%s -> %s", rpc_prog(prog), p);
|
addls[num_addls] = fmt("%s -> %s", rpc_prog(prog), p);
|
||||||
|
++num_addls;
|
||||||
update_RPC_server_map(server, p, rpc_prog(prog));
|
update_RPC_server_map(server, p, rpc_prog(prog));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,17 +186,17 @@ export {
|
||||||
# More precisely, the counter is the next index of threshold vector.
|
# More precisely, the counter is the next index of threshold vector.
|
||||||
global shut_down_thresh_reached: table[addr] of bool &default=F;
|
global shut_down_thresh_reached: table[addr] of bool &default=F;
|
||||||
global rb_idx: table[addr] of count
|
global rb_idx: table[addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
global rps_idx: table[addr] of count
|
global rps_idx: table[addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
global rops_idx: table[addr] of count
|
global rops_idx: table[addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
global rpts_idx: table[addr,addr] of count
|
global rpts_idx: table[addr,addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
global rat_idx: table[addr] of count
|
global rat_idx: table[addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
global rrat_idx: table[addr] of count
|
global rrat_idx: table[addr] of count
|
||||||
&default=1 &read_expire = 1 days &redef;
|
&default=0 &read_expire = 1 days &redef;
|
||||||
}
|
}
|
||||||
|
|
||||||
global thresh_check: function(v: vector of count, idx: table[addr] of count,
|
global thresh_check: function(v: vector of count, idx: table[addr] of count,
|
||||||
|
@ -609,7 +609,7 @@ function thresh_check(v: vector of count, idx: table[addr] of count,
|
||||||
return F;
|
return F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( idx[orig] <= |v| && n >= v[idx[orig]] )
|
if ( idx[orig] < |v| && n >= v[idx[orig]] )
|
||||||
{
|
{
|
||||||
++idx[orig];
|
++idx[orig];
|
||||||
return T;
|
return T;
|
||||||
|
@ -628,7 +628,7 @@ function thresh_check_2(v: vector of count, idx: table[addr, addr] of count,
|
||||||
return F;
|
return F;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( idx[orig,resp] <= |v| && n >= v[idx[orig, resp]] )
|
if ( idx[orig,resp] < |v| && n >= v[idx[orig, resp]] )
|
||||||
{
|
{
|
||||||
++idx[orig,resp];
|
++idx[orig,resp];
|
||||||
return T;
|
return T;
|
||||||
|
|
39
src/Expr.cc
39
src/Expr.cc
|
@ -494,8 +494,7 @@ Val* UnaryExpr::Eval(Frame* f) const
|
||||||
VectorVal* v_op = v->AsVectorVal();
|
VectorVal* v_op = v->AsVectorVal();
|
||||||
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < v_op->Size(); ++i )
|
||||||
i < v_op->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
Val* v_i = v_op->Lookup(i);
|
Val* v_i = v_op->Lookup(i);
|
||||||
result->Assign(i, v_i ? Fold(v_i) : 0, this);
|
result->Assign(i, v_i ? Fold(v_i) : 0, this);
|
||||||
|
@ -633,8 +632,7 @@ Val* BinaryExpr::Eval(Frame* f) const
|
||||||
|
|
||||||
VectorVal* v_result = new VectorVal(Type()->AsVectorType());
|
VectorVal* v_result = new VectorVal(Type()->AsVectorType());
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < v_op1->Size(); ++i )
|
||||||
i < v_op1->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
if ( v_op1->Lookup(i) && v_op2->Lookup(i) )
|
if ( v_op1->Lookup(i) && v_op2->Lookup(i) )
|
||||||
v_result->Assign(i,
|
v_result->Assign(i,
|
||||||
|
@ -656,8 +654,7 @@ Val* BinaryExpr::Eval(Frame* f) const
|
||||||
VectorVal* vv = (is_vec1 ? v1 : v2)->AsVectorVal();
|
VectorVal* vv = (is_vec1 ? v1 : v2)->AsVectorVal();
|
||||||
VectorVal* v_result = new VectorVal(Type()->AsVectorType());
|
VectorVal* v_result = new VectorVal(Type()->AsVectorType());
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < vv->Size(); ++i )
|
||||||
i < vv->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
Val* vv_i = vv->Lookup(i);
|
Val* vv_i = vv->Lookup(i);
|
||||||
if ( vv_i )
|
if ( vv_i )
|
||||||
|
@ -1063,8 +1060,7 @@ Val* IncrExpr::Eval(Frame* f) const
|
||||||
if ( is_vector(v) )
|
if ( is_vector(v) )
|
||||||
{
|
{
|
||||||
VectorVal* v_vec = v->AsVectorVal();
|
VectorVal* v_vec = v->AsVectorVal();
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < v_vec->Size(); ++i )
|
||||||
i < v_vec->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
Val* elt = v_vec->Lookup(i);
|
Val* elt = v_vec->Lookup(i);
|
||||||
if ( elt )
|
if ( elt )
|
||||||
|
@ -1941,7 +1937,7 @@ Val* BoolExpr::Eval(Frame* f) const
|
||||||
{
|
{
|
||||||
result = new VectorVal(Type()->AsVectorType());
|
result = new VectorVal(Type()->AsVectorType());
|
||||||
result->Resize(vector_v->Size());
|
result->Resize(vector_v->Size());
|
||||||
result->AssignRepeat(VECTOR_MIN, result->Size(),
|
result->AssignRepeat(0, result->Size(),
|
||||||
scalar_v, this);
|
scalar_v, this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1970,8 +1966,7 @@ Val* BoolExpr::Eval(Frame* f) const
|
||||||
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
||||||
result->Resize(vec_v1->Size());
|
result->Resize(vec_v1->Size());
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < vec_v1->Size(); ++i )
|
||||||
i < vec_v1->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
Val* op1 = vec_v1->Lookup(i);
|
Val* op1 = vec_v1->Lookup(i);
|
||||||
Val* op2 = vec_v2->Lookup(i);
|
Val* op2 = vec_v2->Lookup(i);
|
||||||
|
@ -2353,7 +2348,7 @@ Val* CondExpr::Eval(Frame* f) const
|
||||||
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
||||||
result->Resize(cond->Size());
|
result->Resize(cond->Size());
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN; i < cond->Size() + VECTOR_MIN; ++i )
|
for ( unsigned int i = 0; i < cond->Size(); ++i )
|
||||||
{
|
{
|
||||||
Val* local_cond = cond->Lookup(i);
|
Val* local_cond = cond->Lookup(i);
|
||||||
if ( local_cond )
|
if ( local_cond )
|
||||||
|
@ -2951,8 +2946,7 @@ Val* IndexExpr::Eval(Frame* f) const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < v_v2->Size(); ++i )
|
||||||
i < v_v2->Size() + VECTOR_MIN; ++i )
|
|
||||||
{
|
{
|
||||||
if ( v_v2->Lookup(i)->AsBool() )
|
if ( v_v2->Lookup(i)->AsBool() )
|
||||||
v_result->Assign(v_result->Size() + 1, v_v1->Lookup(i), this);
|
v_result->Assign(v_result->Size() + 1, v_v1->Lookup(i), this);
|
||||||
|
@ -2964,8 +2958,7 @@ Val* IndexExpr::Eval(Frame* f) const
|
||||||
// S does, i.e., by excluding those elements.
|
// S does, i.e., by excluding those elements.
|
||||||
// Probably only do this if *all* are negative.
|
// Probably only do this if *all* are negative.
|
||||||
v_result->Resize(v_v2->Size());
|
v_result->Resize(v_v2->Size());
|
||||||
for ( unsigned int i = VECTOR_MIN;
|
for ( unsigned int i = 0; i < v_v2->Size(); ++i )
|
||||||
i < v_v2->Size() + VECTOR_MIN; ++i )
|
|
||||||
v_result->Assign(i, v_v1->Lookup(v_v2->Lookup(i)->CoerceToInt()), this);
|
v_result->Assign(i, v_v1->Lookup(v_v2->Lookup(i)->CoerceToInt()), this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3551,9 +3544,9 @@ Val* VectorConstructorExpr::Eval(Frame* f) const
|
||||||
{
|
{
|
||||||
Expr* e = exprs[i];
|
Expr* e = exprs[i];
|
||||||
Val* v = e->Eval(f);
|
Val* v = e->Eval(f);
|
||||||
if ( ! vec->Assign(i + VECTOR_MIN, v, e) )
|
if ( ! vec->Assign(i, v, e) )
|
||||||
{
|
{
|
||||||
Error(fmt("type mismatch at index %d", i + VECTOR_MIN), e);
|
Error(fmt("type mismatch at index %d", i), e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3575,9 +3568,9 @@ Val* VectorConstructorExpr::InitVal(const BroType* t, Val* aggr) const
|
||||||
Expr* e = exprs[i];
|
Expr* e = exprs[i];
|
||||||
Val* v = check_and_promote(e->Eval(0), vt, 1);
|
Val* v = check_and_promote(e->Eval(0), vt, 1);
|
||||||
|
|
||||||
if ( ! v || ! vec->Assign(i + VECTOR_MIN, v, e) )
|
if ( ! v || ! vec->Assign(i, v, e) )
|
||||||
{
|
{
|
||||||
Error(fmt("initialization type mismatch at index %d", i + VECTOR_MIN), e);
|
Error(fmt("initialization type mismatch at index %d", i), e);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3936,7 +3929,7 @@ Val* ArithCoerceExpr::Fold(Val* v) const
|
||||||
|
|
||||||
VectorVal* vv = v->AsVectorVal();
|
VectorVal* vv = v->AsVectorVal();
|
||||||
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
VectorVal* result = new VectorVal(Type()->AsVectorType());
|
||||||
for ( unsigned int i = VECTOR_MIN; i < vv->Size() + VECTOR_MIN; ++i )
|
for ( unsigned int i = 0; i < vv->Size(); ++i )
|
||||||
{
|
{
|
||||||
Val* elt = vv->Lookup(i);
|
Val* elt = vv->Lookup(i);
|
||||||
if ( elt )
|
if ( elt )
|
||||||
|
@ -5053,9 +5046,9 @@ Val* ListExpr::InitVal(const BroType* t, Val* aggr) const
|
||||||
{
|
{
|
||||||
Expr* e = exprs[i];
|
Expr* e = exprs[i];
|
||||||
Val* v = e->Eval(0);
|
Val* v = e->Eval(0);
|
||||||
if ( ! vec->Assign(i + VECTOR_MIN, v, e) )
|
if ( ! vec->Assign(i, v, e) )
|
||||||
{
|
{
|
||||||
e->Error(fmt("type mismatch at index %d", i + VECTOR_MIN));
|
e->Error(fmt("type mismatch at index %d", i));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1051,7 +1051,7 @@ LogVal* LogMgr::ValToLogVal(Val* val, BroType* ty)
|
||||||
for ( int i = 0; i < lval->val.vector_val.size; i++ )
|
for ( int i = 0; i < lval->val.vector_val.size; i++ )
|
||||||
{
|
{
|
||||||
lval->val.vector_val.vals[i] =
|
lval->val.vector_val.vals[i] =
|
||||||
ValToLogVal(vec->Lookup(VECTOR_MIN + i),
|
ValToLogVal(vec->Lookup(i),
|
||||||
vec->Type()->YieldType());
|
vec->Type()->YieldType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
29
src/Val.cc
29
src/Val.cc
|
@ -3231,15 +3231,6 @@ bool VectorVal::Assign(unsigned int index, Val* element, const Expr* assigner,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( index == 0 || index > (1 << 30) )
|
|
||||||
{
|
|
||||||
if ( assigner )
|
|
||||||
assigner->Error(fmt("index (%d) must be positive",
|
|
||||||
index));
|
|
||||||
Unref(element);
|
|
||||||
return true; // true = "no fatal error"
|
|
||||||
}
|
|
||||||
|
|
||||||
BroType* yt = Type()->AsVectorType()->YieldType();
|
BroType* yt = Type()->AsVectorType()->YieldType();
|
||||||
|
|
||||||
if ( yt && yt->Tag() == TYPE_TABLE &&
|
if ( yt && yt->Tag() == TYPE_TABLE &&
|
||||||
|
@ -3254,7 +3245,7 @@ bool VectorVal::Assign(unsigned int index, Val* element, const Expr* assigner,
|
||||||
Val* ival = new Val(index, TYPE_COUNT);
|
Val* ival = new Val(index, TYPE_COUNT);
|
||||||
StateAccess::Log(new StateAccess(OP_ASSIGN_IDX,
|
StateAccess::Log(new StateAccess(OP_ASSIGN_IDX,
|
||||||
this, ival, element,
|
this, ival, element,
|
||||||
(*val.vector_val)[index - 1]));
|
(*val.vector_val)[index]));
|
||||||
Unref(ival);
|
Unref(ival);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3264,10 +3255,10 @@ bool VectorVal::Assign(unsigned int index, Val* element, const Expr* assigner,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( index <= val.vector_val->size() )
|
if ( index < val.vector_val->size() )
|
||||||
Unref((*val.vector_val)[index - 1]);
|
Unref((*val.vector_val)[index]);
|
||||||
else
|
else
|
||||||
val.vector_val->resize(index);
|
val.vector_val->resize(index + 1);
|
||||||
|
|
||||||
if ( LoggingAccess() && op != OP_NONE )
|
if ( LoggingAccess() && op != OP_NONE )
|
||||||
{
|
{
|
||||||
|
@ -3278,14 +3269,14 @@ bool VectorVal::Assign(unsigned int index, Val* element, const Expr* assigner,
|
||||||
|
|
||||||
StateAccess::Log(new StateAccess(op == OP_INCR ?
|
StateAccess::Log(new StateAccess(op == OP_INCR ?
|
||||||
OP_INCR_IDX : OP_ASSIGN_IDX,
|
OP_INCR_IDX : OP_ASSIGN_IDX,
|
||||||
this, ival, element, (*val.vector_val)[index - 1]));
|
this, ival, element, (*val.vector_val)[index]));
|
||||||
Unref(ival);
|
Unref(ival);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: we do *not* Ref() the element, if any, at this point.
|
// Note: we do *not* Ref() the element, if any, at this point.
|
||||||
// AssignExpr::Eval() already does this; other callers must remember
|
// AssignExpr::Eval() already does this; other callers must remember
|
||||||
// to do it similarly.
|
// to do it similarly.
|
||||||
(*val.vector_val)[index - 1] = element;
|
(*val.vector_val)[index] = element;
|
||||||
|
|
||||||
Modified();
|
Modified();
|
||||||
return true;
|
return true;
|
||||||
|
@ -3294,7 +3285,7 @@ bool VectorVal::Assign(unsigned int index, Val* element, const Expr* assigner,
|
||||||
bool VectorVal::AssignRepeat(unsigned int index, unsigned int how_many,
|
bool VectorVal::AssignRepeat(unsigned int index, unsigned int how_many,
|
||||||
Val* element, const Expr* assigner)
|
Val* element, const Expr* assigner)
|
||||||
{
|
{
|
||||||
ResizeAtLeast(index + how_many - 1);
|
ResizeAtLeast(index + how_many);
|
||||||
|
|
||||||
for ( unsigned int i = index; i < index + how_many; ++i )
|
for ( unsigned int i = index; i < index + how_many; ++i )
|
||||||
if ( ! Assign(i, element, assigner) )
|
if ( ! Assign(i, element, assigner) )
|
||||||
|
@ -3306,10 +3297,10 @@ bool VectorVal::AssignRepeat(unsigned int index, unsigned int how_many,
|
||||||
|
|
||||||
Val* VectorVal::Lookup(unsigned int index) const
|
Val* VectorVal::Lookup(unsigned int index) const
|
||||||
{
|
{
|
||||||
if ( index == 0 || index > val.vector_val->size() )
|
if ( index >= val.vector_val->size() )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (*val.vector_val)[index - 1];
|
return (*val.vector_val)[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int VectorVal::Resize(unsigned int new_num_elements)
|
unsigned int VectorVal::Resize(unsigned int new_num_elements)
|
||||||
|
@ -3398,7 +3389,7 @@ bool VectorVal::DoUnserialize(UnserialInfo* info)
|
||||||
{
|
{
|
||||||
Val* v;
|
Val* v;
|
||||||
UNSERIALIZE_OPTIONAL(v, Val::Unserialize(info, TYPE_ANY));
|
UNSERIALIZE_OPTIONAL(v, Val::Unserialize(info, TYPE_ANY));
|
||||||
Assign(i + VECTOR_MIN, v, 0);
|
Assign(i, v, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -969,9 +969,6 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// The minimum index for vectors (0 or 1).
|
|
||||||
const int VECTOR_MIN = 1;
|
|
||||||
|
|
||||||
class VectorVal : public MutableVal {
|
class VectorVal : public MutableVal {
|
||||||
public:
|
public:
|
||||||
VectorVal(VectorType* t);
|
VectorVal(VectorType* t);
|
||||||
|
|
|
@ -2395,7 +2395,7 @@ function any_set%(v: any%) : bool
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorVal* vv = v->AsVectorVal();
|
VectorVal* vv = v->AsVectorVal();
|
||||||
for ( unsigned int i = VECTOR_MIN; i < vv->Size() + VECTOR_MIN; ++i )
|
for ( unsigned int i = 0; i < vv->Size(); ++i )
|
||||||
if ( vv->Lookup(i) && vv->Lookup(i)->AsBool() )
|
if ( vv->Lookup(i) && vv->Lookup(i)->AsBool() )
|
||||||
return new Val(true, TYPE_BOOL);
|
return new Val(true, TYPE_BOOL);
|
||||||
|
|
||||||
|
@ -2413,7 +2413,7 @@ function all_set%(v: any%) : bool
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorVal* vv = v->AsVectorVal();
|
VectorVal* vv = v->AsVectorVal();
|
||||||
for ( unsigned int i = VECTOR_MIN; i < vv->Size() + VECTOR_MIN; ++i )
|
for ( unsigned int i = 0; i < vv->Size(); ++i )
|
||||||
if ( ! vv->Lookup(i) || ! vv->Lookup(i)->AsBool() )
|
if ( ! vv->Lookup(i) || ! vv->Lookup(i)->AsBool() )
|
||||||
return new Val(false, TYPE_BOOL);
|
return new Val(false, TYPE_BOOL);
|
||||||
|
|
||||||
|
@ -2596,8 +2596,8 @@ function order%(v: any, ...%) : index_vec
|
||||||
// adjusting indices as we do so.
|
// adjusting indices as we do so.
|
||||||
for ( i = 0; i < n; ++i )
|
for ( i = 0; i < n; ++i )
|
||||||
{
|
{
|
||||||
int ind = ind_vv[i] + VECTOR_MIN;
|
int ind = ind_vv[i];
|
||||||
result_v->Assign(i + VECTOR_MIN, new Val(ind, TYPE_COUNT), 0);
|
result_v->Assign(i, new Val(ind, TYPE_COUNT), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result_v;
|
return result_v;
|
||||||
|
|
|
@ -114,9 +114,9 @@ function modify()
|
||||||
|
|
||||||
foo15 = 6667/tcp;
|
foo15 = 6667/tcp;
|
||||||
|
|
||||||
foo16[4] = 4;
|
foo16[3] = 4;
|
||||||
foo16[2] = 20;
|
foo16[1] = 20;
|
||||||
++foo16[1];
|
++foo16[0];
|
||||||
|
|
||||||
local x: type1;
|
local x: type1;
|
||||||
x$a = "pop";
|
x$a = "pop";
|
||||||
|
|
|
@ -18,8 +18,8 @@ event bro_init()
|
||||||
|
|
||||||
local v: vector of string;
|
local v: vector of string;
|
||||||
|
|
||||||
v[2] = "2";
|
v[1] = "2";
|
||||||
v[5] = "5";
|
v[4] = "5";
|
||||||
|
|
||||||
Log::write(SSH, [$vec=v]);
|
Log::write(SSH, [$vec=v]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue