mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
Remove enum Opcode.
This commit is contained in:
parent
31ddca863c
commit
0ba382280c
8 changed files with 44 additions and 102 deletions
34
src/Expr.cc
34
src/Expr.cc
|
@ -97,7 +97,7 @@ void Expr::EvalIntoAggregate(const BroType* /* t */, Val* /* aggr */,
|
||||||
Internal("Expr::EvalIntoAggregate called");
|
Internal("Expr::EvalIntoAggregate called");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Expr::Assign(Frame* /* f */, Val* /* v */, Opcode /* op */)
|
void Expr::Assign(Frame* /* f */, Val* /* v */)
|
||||||
{
|
{
|
||||||
Internal("Expr::Assign called");
|
Internal("Expr::Assign called");
|
||||||
}
|
}
|
||||||
|
@ -261,10 +261,10 @@ Expr* NameExpr::MakeLvalue()
|
||||||
return new RefExpr(this);
|
return new RefExpr(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NameExpr::Assign(Frame* f, Val* v, Opcode op)
|
void NameExpr::Assign(Frame* f, Val* v)
|
||||||
{
|
{
|
||||||
if ( id->IsGlobal() )
|
if ( id->IsGlobal() )
|
||||||
id->SetVal(v, op);
|
id->SetVal(v);
|
||||||
else
|
else
|
||||||
f->SetElement(id->Offset(), v);
|
f->SetElement(id->Offset(), v);
|
||||||
}
|
}
|
||||||
|
@ -1007,18 +1007,18 @@ Val* IncrExpr::Eval(Frame* f) const
|
||||||
if ( elt )
|
if ( elt )
|
||||||
{
|
{
|
||||||
Val* new_elt = DoSingleEval(f, elt);
|
Val* new_elt = DoSingleEval(f, elt);
|
||||||
v_vec->Assign(i, new_elt, OP_INCR);
|
v_vec->Assign(i, new_elt);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
v_vec->Assign(i, 0, OP_INCR);
|
v_vec->Assign(i, 0);
|
||||||
}
|
}
|
||||||
op->Assign(f, v_vec, OP_INCR);
|
op->Assign(f, v_vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Val* old_v = v;
|
Val* old_v = v;
|
||||||
op->Assign(f, v = DoSingleEval(f, old_v), OP_INCR);
|
op->Assign(f, v = DoSingleEval(f, old_v));
|
||||||
Unref(old_v);
|
Unref(old_v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2041,9 +2041,9 @@ Expr* RefExpr::MakeLvalue()
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefExpr::Assign(Frame* f, Val* v, Opcode opcode)
|
void RefExpr::Assign(Frame* f, Val* v)
|
||||||
{
|
{
|
||||||
op->Assign(f, v, opcode);
|
op->Assign(f, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
AssignExpr::AssignExpr(Expr* arg_op1, Expr* arg_op2, int arg_is_init,
|
AssignExpr::AssignExpr(Expr* arg_op1, Expr* arg_op2, int arg_is_init,
|
||||||
|
@ -2684,7 +2684,7 @@ Val* IndexExpr::Fold(Val* v1, Val* v2) const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IndexExpr::Assign(Frame* f, Val* v, Opcode op)
|
void IndexExpr::Assign(Frame* f, Val* v)
|
||||||
{
|
{
|
||||||
if ( IsError() )
|
if ( IsError() )
|
||||||
return;
|
return;
|
||||||
|
@ -2704,7 +2704,7 @@ void IndexExpr::Assign(Frame* f, Val* v, Opcode op)
|
||||||
|
|
||||||
switch ( v1->Type()->Tag() ) {
|
switch ( v1->Type()->Tag() ) {
|
||||||
case TYPE_VECTOR:
|
case TYPE_VECTOR:
|
||||||
if ( ! v1->AsVectorVal()->Assign(v2, v, op) )
|
if ( ! v1->AsVectorVal()->Assign(v2, v) )
|
||||||
{
|
{
|
||||||
if ( v )
|
if ( v )
|
||||||
{
|
{
|
||||||
|
@ -2723,7 +2723,7 @@ void IndexExpr::Assign(Frame* f, Val* v, Opcode op)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_TABLE:
|
case TYPE_TABLE:
|
||||||
if ( ! v1->AsTableVal()->Assign(v2, v, op) )
|
if ( ! v1->AsTableVal()->Assign(v2, v) )
|
||||||
{
|
{
|
||||||
if ( v )
|
if ( v )
|
||||||
{
|
{
|
||||||
|
@ -2826,7 +2826,7 @@ int FieldExpr::CanDel() const
|
||||||
return td->FindAttr(ATTR_DEFAULT) || td->FindAttr(ATTR_OPTIONAL);
|
return td->FindAttr(ATTR_DEFAULT) || td->FindAttr(ATTR_OPTIONAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FieldExpr::Assign(Frame* f, Val* v, Opcode opcode)
|
void FieldExpr::Assign(Frame* f, Val* v)
|
||||||
{
|
{
|
||||||
if ( IsError() )
|
if ( IsError() )
|
||||||
return;
|
return;
|
||||||
|
@ -2835,14 +2835,14 @@ void FieldExpr::Assign(Frame* f, Val* v, Opcode opcode)
|
||||||
if ( op_v )
|
if ( op_v )
|
||||||
{
|
{
|
||||||
RecordVal* r = op_v->AsRecordVal();
|
RecordVal* r = op_v->AsRecordVal();
|
||||||
r->Assign(field, v, opcode);
|
r->Assign(field, v);
|
||||||
Unref(r);
|
Unref(r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FieldExpr::Delete(Frame* f)
|
void FieldExpr::Delete(Frame* f)
|
||||||
{
|
{
|
||||||
Assign(f, 0, OP_ASSIGN_IDX);
|
Assign(f, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Val* FieldExpr::Fold(Val* v) const
|
Val* FieldExpr::Fold(Val* v) const
|
||||||
|
@ -4635,7 +4635,7 @@ Expr* ListExpr::MakeLvalue()
|
||||||
return new RefExpr(this);
|
return new RefExpr(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListExpr::Assign(Frame* f, Val* v, Opcode op)
|
void ListExpr::Assign(Frame* f, Val* v)
|
||||||
{
|
{
|
||||||
ListVal* lv = v->AsListVal();
|
ListVal* lv = v->AsListVal();
|
||||||
|
|
||||||
|
@ -4643,7 +4643,7 @@ void ListExpr::Assign(Frame* f, Val* v, Opcode op)
|
||||||
RuntimeError("mismatch in list lengths");
|
RuntimeError("mismatch in list lengths");
|
||||||
|
|
||||||
loop_over_list(exprs, i)
|
loop_over_list(exprs, i)
|
||||||
exprs[i]->Assign(f, (*lv->Vals())[i]->Ref(), op);
|
exprs[i]->Assign(f, (*lv->Vals())[i]->Ref());
|
||||||
|
|
||||||
Unref(lv);
|
Unref(lv);
|
||||||
}
|
}
|
||||||
|
|
12
src/Expr.h
12
src/Expr.h
|
@ -84,7 +84,7 @@ public:
|
||||||
const;
|
const;
|
||||||
|
|
||||||
// Assign to the given value, if appropriate.
|
// Assign to the given value, if appropriate.
|
||||||
virtual void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN);
|
virtual void Assign(Frame* f, Val* v);
|
||||||
|
|
||||||
// Returns the type corresponding to this expression interpreted
|
// Returns the type corresponding to this expression interpreted
|
||||||
// as an initialization. The type should be Unref()'d when done
|
// as an initialization. The type should be Unref()'d when done
|
||||||
|
@ -225,7 +225,7 @@ public:
|
||||||
ID* Id() const { return id; }
|
ID* Id() const { return id; }
|
||||||
|
|
||||||
Val* Eval(Frame* f) const override;
|
Val* Eval(Frame* f) const override;
|
||||||
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
|
void Assign(Frame* f, Val* v) override;
|
||||||
Expr* MakeLvalue() override;
|
Expr* MakeLvalue() override;
|
||||||
int IsPure() const override;
|
int IsPure() const override;
|
||||||
|
|
||||||
|
@ -572,7 +572,7 @@ class RefExpr : public UnaryExpr {
|
||||||
public:
|
public:
|
||||||
explicit RefExpr(Expr* op);
|
explicit RefExpr(Expr* op);
|
||||||
|
|
||||||
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
|
void Assign(Frame* f, Val* v) override;
|
||||||
Expr* MakeLvalue() override;
|
Expr* MakeLvalue() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -615,7 +615,7 @@ public:
|
||||||
void Add(Frame* f) override;
|
void Add(Frame* f) override;
|
||||||
void Delete(Frame* f) override;
|
void Delete(Frame* f) override;
|
||||||
|
|
||||||
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
|
void Assign(Frame* f, Val* v) override;
|
||||||
Expr* MakeLvalue() override;
|
Expr* MakeLvalue() override;
|
||||||
|
|
||||||
// Need to override Eval since it can take a vector arg but does
|
// Need to override Eval since it can take a vector arg but does
|
||||||
|
@ -643,7 +643,7 @@ public:
|
||||||
|
|
||||||
int CanDel() const override;
|
int CanDel() const override;
|
||||||
|
|
||||||
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
|
void Assign(Frame* f, Val* v) override;
|
||||||
void Delete(Frame* f) override;
|
void Delete(Frame* f) override;
|
||||||
|
|
||||||
Expr* MakeLvalue() override;
|
Expr* MakeLvalue() override;
|
||||||
|
@ -963,7 +963,7 @@ public:
|
||||||
BroType* InitType() const override;
|
BroType* InitType() const override;
|
||||||
Val* InitVal(const BroType* t, Val* aggr) const override;
|
Val* InitVal(const BroType* t, Val* aggr) const override;
|
||||||
Expr* MakeLvalue() override;
|
Expr* MakeLvalue() override;
|
||||||
void Assign(Frame* f, Val* v, Opcode op = OP_ASSIGN) override;
|
void Assign(Frame* f, Val* v) override;
|
||||||
|
|
||||||
TraversalCode Traverse(TraversalCallback* cb) const override;
|
TraversalCode Traverse(TraversalCallback* cb) const override;
|
||||||
|
|
||||||
|
|
24
src/ID.cc
24
src/ID.cc
|
@ -59,34 +59,14 @@ void ID::ClearVal()
|
||||||
val = 0;
|
val = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ID::SetVal(Val* v, Opcode op, bool arg_weak_ref)
|
void ID::SetVal(Val* v, bool arg_weak_ref)
|
||||||
{
|
{
|
||||||
if ( op != OP_NONE )
|
|
||||||
{
|
|
||||||
MutableVal::Properties props = 0;
|
|
||||||
|
|
||||||
if ( attrs && attrs->FindAttr(ATTR_TRACKED) )
|
|
||||||
props |= MutableVal::TRACKED;
|
|
||||||
|
|
||||||
if ( props )
|
|
||||||
{
|
|
||||||
if ( v->IsMutableVal() )
|
|
||||||
v->AsMutableVal()->AddProperties(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef DEBUG
|
|
||||||
if ( props )
|
|
||||||
#else
|
|
||||||
if ( debug_logger.IsVerbose() || props )
|
|
||||||
#endif
|
|
||||||
notifiers.Modified(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! weak_ref )
|
if ( ! weak_ref )
|
||||||
Unref(val);
|
Unref(val);
|
||||||
|
|
||||||
val = v;
|
val = v;
|
||||||
weak_ref = arg_weak_ref;
|
weak_ref = arg_weak_ref;
|
||||||
|
notifiers.Modified(this);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
UpdateValID();
|
UpdateValID();
|
||||||
|
|
2
src/ID.h
2
src/ID.h
|
@ -46,7 +46,7 @@ public:
|
||||||
// reference to the Val, the Val will be destroyed (naturally,
|
// reference to the Val, the Val will be destroyed (naturally,
|
||||||
// you have to take care that it will not be accessed via
|
// you have to take care that it will not be accessed via
|
||||||
// the ID afterwards).
|
// the ID afterwards).
|
||||||
void SetVal(Val* v, Opcode op = OP_ASSIGN, bool weak_ref = false);
|
void SetVal(Val* v, bool weak_ref = false);
|
||||||
|
|
||||||
void SetVal(Val* v, init_class c);
|
void SetVal(Val* v, init_class c);
|
||||||
void SetVal(Expr* ev, init_class c);
|
void SetVal(Expr* ev, init_class c);
|
||||||
|
|
23
src/Op.h
23
src/Op.h
|
@ -1,23 +0,0 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
|
||||||
|
|
||||||
#ifndef op_h
|
|
||||||
#define op_h
|
|
||||||
|
|
||||||
// BRO operations.
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
OP_INCR, OP_DECR, OP_NOT, OP_NEGATE,
|
|
||||||
OP_PLUS, OP_MINUS, OP_TIMES, OP_DIVIDE, OP_MOD,
|
|
||||||
OP_AND, OP_OR,
|
|
||||||
OP_LT, OP_LE, OP_EQ, OP_NE, OP_GE, OP_GT,
|
|
||||||
OP_MATCH,
|
|
||||||
OP_ASSIGN,
|
|
||||||
OP_INDEX, OP_FIELD,
|
|
||||||
OP_IN,
|
|
||||||
OP_LIST,
|
|
||||||
OP_CALL,
|
|
||||||
OP_SCHED,
|
|
||||||
OP_NAME, OP_CONST, OP_THIS
|
|
||||||
} BroOP;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -14,19 +14,6 @@ class HashKey;
|
||||||
class ODesc;
|
class ODesc;
|
||||||
class TableVal;
|
class TableVal;
|
||||||
|
|
||||||
enum Opcode { // Op1 Op2 Op3 (Vals)
|
|
||||||
OP_NONE,
|
|
||||||
OP_ASSIGN, // new old
|
|
||||||
OP_ASSIGN_IDX, // idx new old
|
|
||||||
OP_ADD, // idx old
|
|
||||||
OP_INCR, // idx new old
|
|
||||||
OP_INCR_IDX, // idx new old
|
|
||||||
OP_DEL, // idx old
|
|
||||||
OP_PRINT, // args
|
|
||||||
OP_EXPIRE, // idx
|
|
||||||
OP_READ_IDX, // idx
|
|
||||||
};
|
|
||||||
|
|
||||||
// We provide a notifier framework to inform interested parties of
|
// We provide a notifier framework to inform interested parties of
|
||||||
// modifications to selected global IDs/Vals. To get notified about a change,
|
// modifications to selected global IDs/Vals. To get notified about a change,
|
||||||
// derive a class from Notifier and register the interesting IDs/Vals with
|
// derive a class from Notifier and register the interesting IDs/Vals with
|
||||||
|
|
24
src/Val.cc
24
src/Val.cc
|
@ -443,7 +443,7 @@ ID* MutableVal::Bind() const
|
||||||
|
|
||||||
global_scope()->Insert(name, id);
|
global_scope()->Insert(name, id);
|
||||||
|
|
||||||
id->SetVal(const_cast<MutableVal*>(this), OP_NONE, true);
|
id->SetVal(const_cast<MutableVal*>(this), true);
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ void MutableVal::TransferUniqueID(MutableVal* mv)
|
||||||
id = new ID(new_name, SCOPE_GLOBAL, true);
|
id = new ID(new_name, SCOPE_GLOBAL, true);
|
||||||
id->SetType(const_cast<MutableVal*>(this)->Type()->Ref());
|
id->SetType(const_cast<MutableVal*>(this)->Type()->Ref());
|
||||||
global_scope()->Insert(new_name, id);
|
global_scope()->Insert(new_name, id);
|
||||||
id->SetVal(const_cast<MutableVal*>(this), OP_NONE, true);
|
id->SetVal(const_cast<MutableVal*>(this), true);
|
||||||
|
|
||||||
Unref(mv->id);
|
Unref(mv->id);
|
||||||
mv->id = 0;
|
mv->id = 0;
|
||||||
|
@ -1132,7 +1132,7 @@ void TableVal::CheckExpireAttr(attr_tag at)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int TableVal::Assign(Val* index, Val* new_val, Opcode op)
|
int TableVal::Assign(Val* index, Val* new_val)
|
||||||
{
|
{
|
||||||
HashKey* k = ComputeHash(index);
|
HashKey* k = ComputeHash(index);
|
||||||
if ( ! k )
|
if ( ! k )
|
||||||
|
@ -1142,10 +1142,10 @@ int TableVal::Assign(Val* index, Val* new_val, Opcode op)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Assign(index, k, new_val, op);
|
return Assign(index, k, new_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TableVal::Assign(Val* index, HashKey* k, Val* new_val, Opcode op)
|
int TableVal::Assign(Val* index, HashKey* k, Val* new_val)
|
||||||
{
|
{
|
||||||
int is_set = table_type->IsSet();
|
int is_set = table_type->IsSet();
|
||||||
|
|
||||||
|
@ -1227,15 +1227,13 @@ int TableVal::AddTo(Val* val, int is_first_init, bool propagate_ops) const
|
||||||
|
|
||||||
if ( type->IsSet() )
|
if ( type->IsSet() )
|
||||||
{
|
{
|
||||||
if ( ! t->Assign(v->Value(), k, 0,
|
if ( ! t->Assign(v->Value(), k, 0) )
|
||||||
propagate_ops ? OP_ASSIGN : OP_NONE) )
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
v->Ref();
|
v->Ref();
|
||||||
if ( ! t->Assign(0, k, v->Value(),
|
if ( ! t->Assign(0, k, v->Value()) )
|
||||||
propagate_ops ? OP_ASSIGN : OP_NONE) )
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1822,7 +1820,7 @@ int TableVal::ExpandCompoundAndInit(val_list* vl, int k, Val* new_val)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TableVal::CheckAndAssign(Val* index, Val* new_val, Opcode op)
|
int TableVal::CheckAndAssign(Val* index, Val* new_val)
|
||||||
{
|
{
|
||||||
Val* v = 0;
|
Val* v = 0;
|
||||||
if ( subnets )
|
if ( subnets )
|
||||||
|
@ -1834,7 +1832,7 @@ int TableVal::CheckAndAssign(Val* index, Val* new_val, Opcode op)
|
||||||
if ( v )
|
if ( v )
|
||||||
index->Warn("multiple initializations for index");
|
index->Warn("multiple initializations for index");
|
||||||
|
|
||||||
return Assign(index, new_val, op);
|
return Assign(index, new_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TableVal::InitTimer(double delay)
|
void TableVal::InitTimer(double delay)
|
||||||
|
@ -2219,7 +2217,7 @@ RecordVal::~RecordVal()
|
||||||
delete_vals(AsNonConstRecord());
|
delete_vals(AsNonConstRecord());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecordVal::Assign(int field, Val* new_val, Opcode op)
|
void RecordVal::Assign(int field, Val* new_val)
|
||||||
{
|
{
|
||||||
Val* old_val = AsNonConstRecord()->replace(field, new_val);
|
Val* old_val = AsNonConstRecord()->replace(field, new_val);
|
||||||
Unref(old_val);
|
Unref(old_val);
|
||||||
|
@ -2513,7 +2511,7 @@ VectorVal::~VectorVal()
|
||||||
delete val.vector_val;
|
delete val.vector_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VectorVal::Assign(unsigned int index, Val* element, Opcode op)
|
bool VectorVal::Assign(unsigned int index, Val* element)
|
||||||
{
|
{
|
||||||
if ( element &&
|
if ( element &&
|
||||||
! same_type(element->Type(), vector_type->YieldType(), 0) )
|
! same_type(element->Type(), vector_type->YieldType(), 0) )
|
||||||
|
|
14
src/Val.h
14
src/Val.h
|
@ -840,8 +840,8 @@ public:
|
||||||
// version takes a HashKey and Unref()'s it when done. If we're a
|
// version takes a HashKey and Unref()'s it when done. If we're a
|
||||||
// set, new_val has to be nil. If we aren't a set, index may be nil
|
// set, new_val has to be nil. If we aren't a set, index may be nil
|
||||||
// in the second version.
|
// in the second version.
|
||||||
int Assign(Val* index, Val* new_val, Opcode op = OP_ASSIGN);
|
int Assign(Val* index, Val* new_val);
|
||||||
int Assign(Val* index, HashKey* k, Val* new_val, Opcode op = OP_ASSIGN);
|
int Assign(Val* index, HashKey* k, Val* new_val);
|
||||||
|
|
||||||
Val* SizeVal() const override { return val_mgr->GetCount(Size()); }
|
Val* SizeVal() const override { return val_mgr->GetCount(Size()); }
|
||||||
|
|
||||||
|
@ -951,7 +951,7 @@ protected:
|
||||||
|
|
||||||
void CheckExpireAttr(attr_tag at);
|
void CheckExpireAttr(attr_tag at);
|
||||||
int ExpandCompoundAndInit(val_list* vl, int k, Val* new_val);
|
int ExpandCompoundAndInit(val_list* vl, int k, Val* new_val);
|
||||||
int CheckAndAssign(Val* index, Val* new_val, Opcode op = OP_ASSIGN);
|
int CheckAndAssign(Val* index, Val* new_val);
|
||||||
|
|
||||||
bool AddProperties(Properties arg_state) override;
|
bool AddProperties(Properties arg_state) override;
|
||||||
bool RemoveProperties(Properties arg_state) override;
|
bool RemoveProperties(Properties arg_state) override;
|
||||||
|
@ -995,7 +995,7 @@ public:
|
||||||
Val* SizeVal() const override
|
Val* SizeVal() const override
|
||||||
{ return val_mgr->GetCount(record_type->NumFields()); }
|
{ return val_mgr->GetCount(record_type->NumFields()); }
|
||||||
|
|
||||||
void Assign(int field, Val* new_val, Opcode op = OP_ASSIGN);
|
void Assign(int field, Val* new_val);
|
||||||
Val* Lookup(int field) const; // Does not Ref() value.
|
Val* Lookup(int field) const; // Does not Ref() value.
|
||||||
Val* LookupWithDefault(int field) const; // Does Ref() value.
|
Val* LookupWithDefault(int field) const; // Does Ref() value.
|
||||||
|
|
||||||
|
@ -1095,11 +1095,11 @@ public:
|
||||||
// Note: does NOT Ref() the element! Remember to do so unless
|
// Note: does NOT Ref() the element! Remember to do so unless
|
||||||
// the element was just created and thus has refcount 1.
|
// the element was just created and thus has refcount 1.
|
||||||
//
|
//
|
||||||
bool Assign(unsigned int index, Val* element, Opcode op = OP_ASSIGN);
|
bool Assign(unsigned int index, Val* element);
|
||||||
bool Assign(Val* index, Val* element, Opcode op = OP_ASSIGN)
|
bool Assign(Val* index, Val* element)
|
||||||
{
|
{
|
||||||
return Assign(index->AsListVal()->Index(0)->CoerceToUnsigned(),
|
return Assign(index->AsListVal()->Index(0)->CoerceToUnsigned(),
|
||||||
element, op);
|
element);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assigns the value to how_many locations starting at index.
|
// Assigns the value to how_many locations starting at index.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue