mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
tracking of expressions used to define/redef variables
This commit is contained in:
parent
1f15f53f4b
commit
cf79c05e3a
3 changed files with 21 additions and 1 deletions
|
@ -244,6 +244,8 @@ static void build_global(ID* id, Type* t, InitClass ic, Expr* e,
|
|||
|
||||
add_global(id_ptr, std::move(t_ptr), ic, e_ptr, std::move(attrs_ptr), dt);
|
||||
|
||||
id->AddInitExpr(e_ptr);
|
||||
|
||||
if ( dt == VAR_REDEF )
|
||||
zeekygen_mgr->Redef(id, ::filename, ic, std::move(e_ptr));
|
||||
else
|
||||
|
@ -261,7 +263,9 @@ static StmtPtr build_local(ID* id, Type* t, InitClass ic, Expr* e,
|
|||
auto attrs_ptr = attrs ? std::make_unique<std::vector<AttrPtr>>(*attrs) : nullptr;
|
||||
|
||||
auto init = add_local(std::move(id_ptr), std::move(t_ptr), ic,
|
||||
std::move(e_ptr), std::move(attrs_ptr), dt);
|
||||
e_ptr, std::move(attrs_ptr), dt);
|
||||
|
||||
id->AddInitExpr(std::move(e_ptr));
|
||||
|
||||
if ( do_coverage )
|
||||
script_coverage_mgr.AddStmt(init.get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue