mirror of
https://github.com/zeek/zeek.git
synced 2025-10-11 19:18:19 +00:00
ID: use class IntrusivePtr
This commit is contained in:
parent
c3ea246237
commit
edde591748
12 changed files with 71 additions and 87 deletions
|
@ -272,7 +272,7 @@ IntrusivePtr<Expr> NameExpr::MakeLvalue()
|
|||
void NameExpr::Assign(Frame* f, IntrusivePtr<Val> v)
|
||||
{
|
||||
if ( id->IsGlobal() )
|
||||
id->SetVal(v.release());
|
||||
id->SetVal(std::move(v));
|
||||
else
|
||||
f->SetElement(id.get(), v.release());
|
||||
}
|
||||
|
@ -4241,10 +4241,10 @@ LambdaExpr::LambdaExpr(std::unique_ptr<function_ingredients> arg_ing,
|
|||
// Update lamb's name
|
||||
dummy_func->SetName(my_name.c_str());
|
||||
|
||||
Val* v = new Val(dummy_func);
|
||||
auto v = make_intrusive<Val>(dummy_func);
|
||||
Unref(dummy_func);
|
||||
id->SetVal(v); // id will unref v when its done.
|
||||
id->SetType(ingredients->id->Type()->Ref());
|
||||
id->SetVal(std::move(v));
|
||||
id->SetType({NewRef{}, ingredients->id->Type()});
|
||||
id->SetConst();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue