mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
tracking of when statements/expressions occur in a "when" context
This commit is contained in:
parent
5a32e58e04
commit
9ada7ac4e7
6 changed files with 45 additions and 17 deletions
|
@ -1863,7 +1863,7 @@ ExprPtr IndexExpr::Duplicate()
|
|||
{
|
||||
auto op1_d = op1->Duplicate();
|
||||
auto op2_l = op2->Duplicate()->AsListExprPtr();
|
||||
return SetSucc(new IndexExpr(op1_d, op2_l, is_slice));
|
||||
return SetSucc(new IndexExpr(op1_d, op2_l, is_slice, is_inside_when));
|
||||
}
|
||||
|
||||
bool IndexExpr::HasReducedOps(Reducer* c) const
|
||||
|
|
|
@ -129,7 +129,15 @@ TraversalCode ProfileFunc::PreStmt(const Stmt* s)
|
|||
return TC_ABORTSTMT;
|
||||
|
||||
case STMT_WHEN:
|
||||
{
|
||||
++num_when_stmts;
|
||||
|
||||
auto w = s->AsWhenStmt();
|
||||
auto wi = w->Info();
|
||||
auto wl = wi ? wi->Lambda() : nullptr;
|
||||
if ( wl )
|
||||
lambdas.push_back(wl.get());
|
||||
}
|
||||
break;
|
||||
|
||||
case STMT_FOR:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue