mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
fix for analyzing variable usage inside of table initializers
This commit is contained in:
parent
86aafb7c84
commit
22af54dda2
1 changed files with 11 additions and 0 deletions
|
@ -812,6 +812,17 @@ TraversalCode RD_Decorate::PreExpr(const Expr* e)
|
||||||
auto lhs = a->Op1();
|
auto lhs = a->Op1();
|
||||||
auto rhs = a->Op2();
|
auto rhs = a->Op2();
|
||||||
|
|
||||||
|
if ( lhs->Tag() == EXPR_LIST &&
|
||||||
|
rhs->GetType()->Tag() != TYPE_ANY )
|
||||||
|
{
|
||||||
|
// This combination occurs only for assignments used
|
||||||
|
// to initialize table entries. Treat it as references
|
||||||
|
// to both the lhs and the rhs, not as an assignment.
|
||||||
|
mgr.SetPreFromPre(a->GetOp1().get(), a);
|
||||||
|
mgr.SetPreFromPre(a->GetOp2().get(), a);
|
||||||
|
return TC_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
bool rhs_aggr = IsAggr(rhs);
|
bool rhs_aggr = IsAggr(rhs);
|
||||||
|
|
||||||
mgr.SetPreFromPre(lhs, a);
|
mgr.SetPreFromPre(lhs, a);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue